Re: Is this legal SQL? Is it a good practice? - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: Is this legal SQL? Is it a good practice?
Date
Msg-id 200408242309.44134.peter_e@gmx.net
Whole thread Raw
In response to Is this legal SQL? Is it a good practice?  (Carlos Moreno <moreno@mochima.com>)
Responses Re: Is this legal SQL? Is it a good practice?
List pgsql-general
Carlos Moreno wrote:
> I just noticed that from a C or C++ program using
> libpq or libpq++, I can send *one* command that
> contains several SQL statements separated by
> semicolon.

> But I'm wondering -- is this a PostgreSQL extension,
> or is it "legal SQL"?

The whole libpq API is made up out of thin air, so it's not conforming
to any public standard.

> In particular, I'm wondering
> if it is a feature that in the future you might
> decide to eliminate for not being ANSI-SQL compliant.

Because of the above, that cannot be a reason for eliminating any
interfaces.

> What happens if the first command is ok but the second
> one fails?

All the commands are run in one transaction, so if one fails, the whole
sequence is rolled back.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem to connect to the Windows Port
Next
From: Doug McNaught
Date:
Subject: Re: Problem to connect to the Windows Port