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

From Mario Weilguni
Subject Re: InitPostgres and flatfiles question
Date
Msg-id 200701041641.36860.mweilguni@sime.com
Whole thread Raw
In response to Re: InitPostgres and flatfiles question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Am Donnerstag, 4. Januar 2007 16:36 schrieb Tom Lane:
> Markus Schiltknecht <markus@bluegap.ch> writes:
> 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.
>
> I wonder whether we ought to change that?  The point of
> PreventTransactionChain is that we don't want the user rolling back
> the statement post-completion, but it seems that
>     psql -c 'CREATE DATABASE foo; ABORT; BEGIN; ...'
> would bypass the check.

Maybe not directly related to that problem, but I had a problem with "-c" last 
month, when I noticed that this will not work:

psql -c "set client_encoding=iso-8859-1; select name from customer" (UTF8 
database, output is hmmm... broken german umlauts).

Best regardsMario Weilguni


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Odd numeric->float4/8 casting behaviour
Next
From: "Simon Riggs"
Date:
Subject: Re: [PATCHES] wal_checksum = on (default) | off