Re: Comments in .sql files - Mailing list pgsql-general

From Claudio Lapidus
Subject Re: Comments in .sql files
Date
Msg-id BAY7-DAV18Fo1v7R7XA0000f969@hotmail.com
Whole thread Raw
In response to Comments in .sql files  ("Chad N. Tindel" <chad@tindel.net>)
Responses Re: Comments in .sql files  (Richard Huxton <dev@archonet.com>)
List 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 by date:

Previous
From: Andrei Verovski (aka MacGuru)
Date:
Subject: UPDATE sql question
Next
From: Rajesh Kumar Mallah
Date:
Subject: Re: COPY command