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

From Harald Fuchs
Subject Re: ISO something like "#if 0 ... #endif" for SQL code
Date
Msg-id pur6ei2yhk.fsf@srv.protecting.net
Whole thread Raw
In response to ISO something like "#if 0 ... #endif" for SQL code  ("Kynn Jones" <kynnjo@gmail.com>)
List pgsql-general
In article <DD18D9BB-C92D-4B4B-9829-54AC88152B0E@solfertje.student.utwente.nl>,
Alban Hertroys <dalroi@solfertje.student.utwente.nl> writes:

>> 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?

> I have been playing with the idea of using cpp to pre-process such
> files, and maybe even put them in a Makefile. I don't think there's
> any reason that wouldn't be possible with SQL files. Added bonus, you
> can use macros in your SQL, for things like environment paths (for
> including other SQL files for example) etc.

If it's OK to preprocess SQL, you could also use the M4 macro
processor which comes with every decent operating system (i.e. Unix).

pgsql-general by date:

Previous
From: "Webb Sprague"
Date:
Subject: Re: how do you write aggregate function
Next
From: frant101@googlemail.com
Date:
Subject: Reindexdb + relation error