ISO something like "#if 0 ... #endif" for SQL code - Mailing list pgsql-general

From Kynn Jones
Subject ISO something like "#if 0 ... #endif" for SQL code
Date
Msg-id c2350ba40803100850u670a9cc9tf630f65c1e63b847@mail.gmail.com
Whole thread Raw
Responses Re: ISO something like "#if 0 ... #endif" for SQL code  (Craig Ringer <craig@postnewspapers.com.au>)
Re: ISO something like "#if 0 ... #endif" for SQL code  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Re: ISO something like "#if 0 ... #endif" for SQL code  (Sam Mason <sam@samason.me.uk>)
Re: ISO something like "#if 0 ... #endif" for SQL code  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
List pgsql-general



Hi!  When it comes to programming SQL, my newbie approach is to write my code in a file test.sql, which I test from within psql by using

  my_db=> \i /some/path/test.sql

...and (once I'm satisfied with the code) copy and paste it to a different file that has the SQL I've written so far for the project.

It's a rather cumbersome system, all the more so because I don't have a convenient way to comment out large chunks of code (which may include C-style comments).

I'm thinking of something like the trick of surrounding C code with pairs of #if 0 and #endif, which effectively comments out code, even when it contains /* C-style comments */.

Is there some similar trick for SQL code?

TIA!

Kynn

pgsql-general by date:

Previous
From: "Steven Flatt"
Date:
Subject: restore_command %r option
Next
From: Dimitri Fontaine
Date:
Subject: Re: [PERFORM] multi-threaded pgloader makes it in version 2.3.0