Re: InitPostgres and flatfiles question - Mailing list pgsql-hackers

From Tom Lane
Subject Re: InitPostgres and flatfiles question
Date
Msg-id 9568.1167970419@sss.pgh.pa.us
Whole thread Raw
In response to Re: InitPostgres and flatfiles question  (Bruce Momjian <bruce@momjian.us>)
Responses Re: InitPostgres and flatfiles question
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> Tom Lane wrote:
>> The only argument I can think of is that it allows applications to be
>> sloppy about parsing a SQL script into individual commands before they
>> send it.  (I think initdb may be guilty of exactly that BTW...)  At the
>> same time you could argue that such sloppiness is inherently a Bad Idea.

> I thought the idea was that psql was going to split multiple -c commands
> into separate PQexec() calls, so sloppy was OK, and if they want a
> single transaction, add BEGIN/END to the string.

No, psql isn't the point: we can certainly make its behavior match the
backend's.  What I'm wondering about is the effect on random PG-using
applications: should we forbid them from sending multiple SQL commands
per PQexec (or equivalent in other client library APIs)?

Backwards compatibility says no, but you can make some decent arguments
for forbidding it anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: InitPostgres and flatfiles question
Next
From: Bruce Momjian
Date:
Subject: Re: InitPostgres and flatfiles question