1

Is there a "set -x" for the Postgres prompt/repl ?

In bash when you want to execute a set of commands, and come back to check it after lunch you can do

set -x
command1
command2
command3

and bash prints out the command to STDOUT just before it executes it. this is helpful to see, what's taking a long time, which did line did it last execute, etc.

Similarly, inside the psql console, I also do sets of long running commands:

VACUUM FULL VERBOSE ANALYZE events;
REINDEX VERBOSE TABLE events;

Can I do

set -x
VACUUM FULL VERBOSE ANALYZE events;
REINDEX VERBOSE TABLE events;

so that when I come back from lunch I can see which one of my commands was the last one it did.

1 Answer 1

2

I guess you want \set ECHO queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.