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

From Markus Schiltknecht
Subject Re: InitPostgres and flatfiles question
Date
Msg-id 459D2B37.4080704@bluegap.ch
Whole thread Raw
In response to Re: InitPostgres and flatfiles question  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: InitPostgres and flatfiles question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

Tom Lane wrote:
> Hm, that's an interesting point.  psql's -c just shoves its whole
> argument string at the backend in one PQexec(), instead of dividing
> at semicolons as psql does with normal input.  And so it winds up as
> a single transaction because postgres.c doesn't force a transaction
> commit until the end of the querystring.  But that's not a "transaction
> block" in the normal sense and so it doesn't trigger the
> PreventTransactionChain defense in CREATE DATABASE and elsewhere.

Is there a good reason to not let psql -c behave exactly like psql from 
STDIN? I found this exception to be quite confusing. Of course that 
could break compatibility with certain scripts, but can this be fixed 
without doing so?

Regards

Markus



pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Odd numeric->float4/8 casting behaviour
Next
From: Bill Moran
Date:
Subject: Re: [PATCHES] Patch to log usage of temporary files