When executing multiple SQL commands, such as in the pgAdmin SQL Editor, how can I print some strings to the console (output pane in pgAdmin). I want to monitor execution.
UPDATE x
SET a = b
WHERE a IS NULL
;
Print to console --> Finished x.
UPDATE y
SET a = b
WHERE a IS NULL
;
Print to console --> Finished y.
My question is the same as this StackOverflow Question. Or, as Craig Ringer interpreted that Question:
Do you wish to observe SQL queries that are run by PgAdmin-III by printing them to standard error, viewed by launching PgAdmin-III on a cmd.exe interactive console?
I have seen remarks about \echo 'some_text'
. But that gives me the error:
ERROR: syntax error at or near "\"
SQL state: 42601
SELECT 'some text';
\echo
of apsql
command, you cannot use it in pgAdmin. If you want an error-like message (like a warning or such), you can create a pl/pgsql function that emits a message of the desired level using an incoming parameter, like the one I used here.ROLLBACK
for testing purposes) and I try to know the content of a table mid-way through...