Re: [PATCH] Make "psql -1 < file.sql" work as with "-f"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Make "psql -1 < file.sql" work as with "-f"
Дата
Msg-id 8770.1368201799@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Make "psql -1 < file.sql" work as with "-f"  (Christopher Browne <cbbrowne@gmail.com>)
Список pgsql-hackers
Christopher Browne <cbbrowne@gmail.com> writes:
> On Fri, May 10, 2013 at 9:50 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
>> My first use of 9.3beta1 in development failed because of changes
>> introduced by this patch, specifically because of the newly introduced
>> error
>> 
>> psql: -1 is incompatible with -c and -l
>> 
>> I'm not convinced this is correct.  -c and -l are single-transaction
>> actions almost by definition.
>> 
>> This particular aspect of the change wasn't really brought up in the
>> original thread.  What was your thinking?

> I'm not sure I agree with you vis-a-vis the -c option, as it is certainly
> plausible/meaningful
> to do:
>   psql -c "begin; update [something]; insert [something]; delete
> [something]; commit;"
> and for that to be different from
>   psql -c "update [something]; insert [something]; delete [something];"

While it might be *plausible* for those to be different, that's not
actually how -c works in practice, because it sends the string as a
single PQexec, which has the effect of making the string a single
transaction even if the string does not contain begin/end explicitly.

I think Peter is right and this error is bogus.  Whatever redeeming
social value it might have for sticklers is not worth breaking existing
apps for.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Concurrent HOT Update interference
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: corrupt pages detected by enabling checksums