Re: Comments in .sql files

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Chad N(dot) Tindel" <chad(at)tindel(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Comments in .sql files
Date: 2003-08-01 00:44:53
Message-ID: 2299.1059698693@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Chad N. Tindel" <chad(at)tindel(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-08-01 00:50:50 Re: owner cant delete from table, permission denied
Previous Message Randal L. Schwartz 2003-07-31 23:05:48 "field upgrade" of OSCON 2003 T-shirt