Re: CREATE DATABASE cannot be executed from a function or multi-command string

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: CREATE DATABASE cannot be executed from a function or multi-command string
Дата
Msg-id 46F7B92E.9040004@postgresql.org
обсуждение исходный текст
Ответ на Re: CREATE DATABASE cannot be executed from a function or multi-command string  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Andrew Dunstan wrote:
> 
> src/bin/psql/common.c has a routine that lets psql get round this, by 
> not sending a BEGIN in the case of the offending statements. I have no 
> idea if this might be helpful for pgadmin though.

Yeah, unfortunately it's not that we wrap the statement in a begin/end -  we rely on the fact that each call to PQexec
isimplicitly a single 
 
transaction.

We're aware of course that CREATE DATABASE can't run in a transaction 
block but just turned a blind eye to that on the grounds that it was 
much more likely to fail than any of the other statements following it 
in the multi-statement and we weren't about to start rolling it back 
ourselves anyway.

Thanks, Dave.


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

Предыдущее
От: Martin Pihlak
Дата:
Сообщение: Re: stored procedure stats in collector
Следующее
От: Thea
Дата:
Сообщение: Re: LIKE wildcards escaping problem