Re: missing semicolon at end of psql files - Mailing list pgsql-hackers

From Noah Misch
Subject Re: missing semicolon at end of psql files
Date
Msg-id 20120913123548.GC12235@tornado.leadboat.com
Whole thread Raw
In response to Re: missing semicolon at end of psql files  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Sep 12, 2012 at 03:20:24PM -0400, Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > I was surprised to find that psql -f file.sql with a file such as this
> > select 1;
> > select 2
> 
> > executes both commands even though the second one is not terminated.

> I'm a little dubious about changing this behavior.  As you say, it's
> not like we're consistent about requiring semicolons everywhere, and
> frankly I think the argument about truncated files is specious.
> I've never heard of that actually happening to anybody.
> 
> What would you have it do instead?  Throw an error?  Silently drop
> the last command (which would be the same thing, if nobody was paying
> attention to the error message)?  I think the compatibility lossage
> from either would outweigh the benefit.

Fully agreed.



pgsql-hackers by date:

Previous
From: Shigeru HANADA
Date:
Subject: Re: Move postgresql_fdw_validator into dblink
Next
From: Noah Misch
Date:
Subject: Re: remove dead ports?