Re: ISO something like "#if 0 ... #endif" for SQL code

Поиск
Список
Период
Сортировка
От Harald Fuchs
Тема Re: ISO something like "#if 0 ... #endif" for SQL code
Дата
Msg-id pur6ei2yhk.fsf@srv.protecting.net
обсуждение исходный текст
Ответ на ISO something like "#if 0 ... #endif" for SQL code  ("Kynn Jones" <kynnjo@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "Webb Sprague"
Дата:
Сообщение: Re: how do you write aggregate function
Следующее
От: frant101@googlemail.com
Дата:
Сообщение: Reindexdb + relation error