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

From Peter Eisentraut
Subject missing semicolon at end of psql files
Date
Msg-id 1347459040.16215.5.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: missing semicolon at end of psql files  (Dmitriy Igrishin <dmitigr@gmail.com>)
Re: missing semicolon at end of psql files  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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 realize that this is inconsistently handled throughout the system, for
example libpq APIs don't care about the missing semicolon, but
interactive psql does.

But what bothered me about this is that if a file gets truncated by
accident, there could be an unqualified DELETE or something similar at
the end.

Comments?





pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Doc typo: lexems -> lexemes
Next
From: Peter Eisentraut
Date:
Subject: git author vs committer