Re: InitPostgres and flatfiles question
От | Mario Weilguni |
---|---|
Тема | Re: InitPostgres and flatfiles question |
Дата | |
Msg-id | 200701041641.36860.mweilguni@sime.com обсуждение исходный текст |
Ответ на | Re: InitPostgres and flatfiles question (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | 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 по дате отправления: