Re: Comments in .sql files

From: "Claudio Lapidus" <clapidus(at)hotmail(dot)com>
To: "Chad N(dot) Tindel" <chad(at)tindel(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Comments in .sql files
Date: 2003-08-01 03:54:11
Message-ID: BAY7-DAV18Fo1v7R7XA0000f969@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rajesh Kumar Mallah 2003-08-01 04:02:30 Re: COPY command
Previous Message Rajesh Kumar Mallah 2003-08-01 03:40:31 Re: Views With Unions