Display output file name in psql prompt? - Mailing list pgsql-hackers

From Alex
Subject Display output file name in psql prompt?
Date
Msg-id 87zjy8bczt.fsf@commandprompt.com
Whole thread Raw
Responses Re: Display output file name in psql prompt?
List pgsql-hackers
Hello fellow hackers,

Today when I get back home and connected to my psql prompt I've left
running under $terminal_multiplexor I've run some SQL, but no output did
appear on my screen.  I have immediately realized that it must be
sending it to a file instead of STDOUT as I have instructed it earlier
today using \o command, but have totally forgot about the fact.

So I wonder if there's a way to make psql display the current output
file/command in the prompt?  After reading the current docs, I don't see
any option.  Would a patch be accepted for submission (make it into
default prompt, unless stdout?)

Something like this:

\set PROMPT1 '%/:%o%R%# '
postgres:/path/to/output/file.txt=>

--
Regards,
Alex

PS: upon reading the docs more carefully, I guess I should have used \g
instead of \o, but still this might be not a bad feature to have.



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Incorrect handling of timezones with extract
Next
From: Tom Lane
Date:
Subject: Re: Display output file name in psql prompt?