[wplug] Postgres script comment
John Harrold
jmh17 at pitt.edu
Thu Nov 13 15:39:09 EST 2003
Sometime in November Andreas Rindler assaulted the keyboard and produced:
| hey,
| i am populating a lot of data in postgres using sql scripts and the \i
| command. how can i include a comment in the sql file that will print to
| the psql screen during runtime??
|
| eg:
|
| In the sql file:
|
| create table test(col1 number, col2 number);
| --comment: creating table test
|
| Which should show up in the psql prompt as:
|
| CREATE TABLE
| comment: creating table test
this should work:
\echo creating table test
from the psql prompt, you know:
$ psql dbname
dbname=# \?
...
\e [FILE] edit the query buffer (or file) with external editor
\echo [STRING] write string to standard output
\encoding [ENCODING] show or set client encoding
...
--
--------------------------------------------------------------------------
| /"\
john harrold | \ / ASCII ribbon campaign
jmh at member.fsf.org | X against HTML mail
the most useful idiot | / \
--------------------------------------------------------------------------
What difference does it make to the dead, the orphans, and the homeless,
whether the mad destruction is brought under the name of totalitarianism or
the holy name of liberty and democracy?
--Gandhi
--------------------------------------------------------------------------
gpg --keyserver keys.indymedia.org --recv-key F65A739E
--------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://penguin.wplug.org/pipermail/wplug/attachments/20031113/0f6e94aa/attachment-0001.bin
More information about the wplug
mailing list