Re: InitPostgres and flatfiles question

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Markus Schiltknecht <markus(at)bluegap(dot)ch>
Subject: Re: InitPostgres and flatfiles question
Date: 2007-01-04 15:41:36
Message-ID: 200701041641.36860.mweilguni@sime.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Am Donnerstag, 4. Januar 2007 16:36 schrieb Tom Lane:
> Markus Schiltknecht <markus(at)bluegap(dot)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 regards
Mario Weilguni

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-01-04 15:56:39 Re: wal_checksum = on (default) | off
Previous Message Gregory Stark 2007-01-04 15:37:59 Odd numeric->float4/8 casting behaviour