Possibly from the 1970s or 1980s. Humans can't pilot a spaceship without going insane, so spaceship pilots have a secondary personality that kicks in as they walk through the cockpit door. The pilot can't remember anything that happens after that, until they go back through the door and their own personality comes back. The pilot later finds out that he has a third personality which takes over in an emergency.
This is Captain Bedlam, a short story by the late Harry Harrison, part of his Two Tales and Eight Tomorrows series published between 1958 and 1965. You may have read a reprinted version of it in the 70s or 80s.
The best description I could find is from the book Building New Worlds, 1946-1959: The Carnell Era, Volume One, but it matches perfectly:
"Captain Bedlam" (69), reprinted from the December 1957 US Space Adventures, proposes that humans can't stand up to the stress of space flight, and the only way to get around the problem is to induce a second personality to pilot the spaceships. The main personality never sees space and experiences only periods of amnesia. But the protagonist gets into real trouble, and his main personality wakes up just long enough to see the stars, before the third personality is invoked to deal with the emergency at the cost of considerable injury.
I found this by searching the web for "science fiction spaceship second personality"; the above Google Books page was the 8th result (the 1st was your question, but that's probably because my search engine knows I spend a lot of time on this site).