Andres Freund <andres@anarazel.de> writes:
> One of the OP's examples shows the connection establishment separate
> from the slowdown however. Shouldn't that preclude relcache init file
> rebuilds being involved?
Hmm ... I was thinking that psql might be able to produce a prompt before
the connected backend was done initializing, but after a bit more poking
into the code that seems unlikely. Still, it might be interesting to
verify whether the first command is fast if it's one that requires no
catalog access. Maybe "set enable_hashjoin = 1" or suchlike (being
careful not to invoke tab completion to type it ;-)).
regards, tom lane