3

I'm running a large sql script with postgres as follows:

psql < scriptname.sql

Each sql statement has a comment explaining (using -- syntax) what it does but it isnt output, and its difficult to match up each statement with output. I simply want to output the comments together with the results of the statements

1

2 Answers 2

4

Search for the \echo command in the psql reference.

This is psql specific though...

Sign up to request clarification or add additional context in comments.

Comments

2

Turn echo on with

--echo-all

then use it with \echo type your text

\echo My comment

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.