![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
hi, I was wondering again (I'd asked this a while back but can't find in archives) ..... how can I make an sql comment? For example this script ..... ************************************************** ***** select mazurek(1); -- test SELECT count(*) as master_count FROM master; SELECT count(*) as detail_count FROM detail; ************************************************** ***** gives me this result: ************************************************** ***** test=# \e mazurek_test.sql mazurek ------------------------------------------ less references in master than in detail (1 row) test=# ************************************************** ***** which is the return value from the function, and all further output is killed by the comment. so it produces no output after the --test. WASN'T THAT A COMMENT? I have also tried.... --test (without the space) to no avail joe -- speigle www.sirfsup.com ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings |
#3
| |||
| |||
|
|
In your example you must use \i and not \e |
#4
| |||
| |||
|
|
Bruno LEVEQUE <bruno.leveque (AT) net6d (DOT) com> writes: In your example you must use \i and not \e On investigation, this is actually a bug in the way \e works --- when the file is read back into psql, it's effectively treated as a single line, and so the comment kills more than you'd expect. I am amused to realize that the bug is fixed in CVS tip, as a completely unintended consequence of the flex rewrite I just did ... But I agree that \i not \e is the preferred way to invoke a SQL file that already exists. I am not sure if that's what Joe was trying to do or not. regards, tom lane joe |
![]() |
| Thread Tools | |
| Display Modes | |
| |