Re: Comments in .sql files

Поиск
Список
Период
Сортировка
От Claudio Lapidus
Тема Re: Comments in .sql files
Дата
Msg-id BAY7-DAV18Fo1v7R7XA0000f969@hotmail.com
обсуждение исходный текст
Ответ на Comments in .sql files  ("Chad N. Tindel" <chad@tindel.net>)
Ответы Re: Comments in .sql files  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
> 1.  It obviously doesn't like the # notation for comments.  What is the
proper
> way to put comments in schema files?

Start the comment with two hyphens, like this:

-- This is a comment. It will continue up to the newline.

>
> 2.  Why does postgres ignore the first insert?  Shouldn't it just barf on
> the "#" line and keep going?

Since PG isn't parsing the '#', it discards all entry up to (what it thinks
is) the end of the statement, i.e. up to the next semicolon. Bear in mind
that newlines are, in general, treated like whitespace, so they don't have
any syntactic value.

hth,
cl.

В списке pgsql-general по дате отправления:

Предыдущее
От: Andrei Verovski (aka MacGuru)
Дата:
Сообщение: UPDATE sql question
Следующее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: COPY command