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

From Tom Lane
Subject Re: Comments in .sql files
Date
Msg-id 2299.1059698693@sss.pgh.pa.us
Whole thread Raw
In response to Comments in .sql files  ("Chad N. Tindel" <chad@tindel.net>)
Responses Bug in comment parsing? [was: Re: Comments in .sql files]  (Rory Campbell-Lange <rory@campbell-lange.net>)
List pgsql-general
"Chad N. Tindel" <chad@tindel.net> writes:
> 1.  It obviously doesn't like the # notation for comments.  What is the proper
> way to put comments in schema files?

The SQL-standard comment syntaxes are

    -- comment to end of line

    /* C-like comment, possibly multiple lines */

We do both.  There are a lot of not-SQL-standard comment syntaxes
accepted by various other databases ...

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

Since it doesn't think # is a comment introducer, it sees an invalid
multiline statement running up to the first ';'.

> 3.  Is there a way to turn of the notices about creating implicit sequences
> and indices?

Set client_min_messages higher than NOTICE.

            regards, tom lane

pgsql-general by date:

Previous
From: "Cory 'G' Watson"
Date:
Subject: Re: optimum postgres server configuration
Next
From: R C
Date:
Subject: Problem install DBD-pg in Redhat Linux 7.2