I like to use psql
, and sometimes I commenting part of query (usually one line) - something like "quick fix and see what you get".
Internal psql
editor is not suitable for big queries, and so often I'm using external editor via \e
(currently it's vim
).
The problem is when some part of query is currently commented in psql
, then it appearing as empty line in external editor.
How I can configure psql
to not remove comments when external editor is called?
I always used /* COMMENT */
for temporarily commenting part of code, because I thought it would loose the rest on a query (after --
) cos it converts code to one line
The new query buffer is then re-parsed according to the normal rules of psql, where the whole buffer is treated as a single line
(((I had same bug in Oracle 8.smth something - dumping package it was ignoring all characters after --
comment in package code)))
Surprisingly \e
editor loses only one line (the commented with --
one).
Answer: use /**/
commenting and it will keep comment through runs
Hint: if you use vim
you can jump to the end of line by ESC + $
sequence, so it is not big difference in efforts from --
commenting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With