Re: Surprising behaviour of \set AUTOCOMMIT ON

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Surprising behaviour of \set AUTOCOMMIT ON
Дата
Msg-id 6ff3bee7-183f-4448-9cd3-881c66c63826@mm
обсуждение исходный текст
Ответ на Re: Surprising behaviour of \set AUTOCOMMIT ON  (Rushabh Lathia <rushabh.lathia@gmail.com>)
Ответы Re: Surprising behaviour of \set AUTOCOMMIT ON  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Surprising behaviour of \set AUTOCOMMIT ON  (Rahila Syed <rahilasyed90@gmail.com>)
Список pgsql-hackers
    Rushabh Lathia wrote:

> It might happen that SetVariable() can be called from other places in
> future,
> so its good to have all the set variable related checks inside
> SetVariable().

There's already another way to skip the \set check: select 'on' as "AUTOCOMMIT" \gset

But there's a function in startup.c which might be the ideal location
for the check, as it looks like the one and only place where the
autocommit flag actually changes:

static void
autocommit_hook(const char *newval)
{    pset.autocommit = ParseVariableBool(newval, "AUTOCOMMIT");
}



Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite



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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: Surprising behaviour of \set AUTOCOMMIT ON
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: autonomous transactions