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/