Re: Parser abort ignoring following commands - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Parser abort ignoring following commands
Date
Msg-id 3B0FFB12.C42FD179@tm.ee
Whole thread Raw
In response to Re: Parser abort ignoring following commands  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut wrote:
> 
> Tom Lane writes:
> 
> > Peter Eisentraut <peter_e@gmx.net> writes:
> > > No, I think there is another problem.  How about something without
> > > selects:
> >
> > > $ psql -c 'delete from pk; delete from xx;'
> > > ERROR:  Relation 'xx' does not exist
> >
> > > "pk" exists, but nothing is deleted.
> >
> > Sure, because the transaction is rolled back.  The whole string
> > is executed in one transaction.  You will definitely break existing
> > applications if you change that.
> 
> Applications that rely on this behaviour are broken.  It was always said
> that statements are in their own transaction block unless in an explicit
> BEGIN/COMMIT block.  A statement is defined to end at the semicolon, not
> at the end of the string you submit to PQexec().

I guess that this is a multi-command statement ?

It has always been so, except that psql seems to do some parsing and
issue 
each command to backend separately.

----------------
Hannu


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: First version of multi-key index support for GiST
Next
From: Adam Haberlach
Date:
Subject: Re: Parser abort ignoring following commands