Re: Is there a way to run CREATE TABLESPACE within a stored procedure?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Is there a way to run CREATE TABLESPACE within a stored procedure?
Дата
Msg-id 20070720141415.GB85514@winnie.fuhr.org
обсуждение исходный текст
Ответ на Is there a way to run CREATE TABLESPACE within a stored procedure?  ("Abraham, Danny" <danny_abraham@bmc.com>)
Список pgsql-admin
On Thu, Jul 19, 2007 at 02:53:50PM +0300, Abraham, Danny wrote:
> Fails on: Cannot run inside a transaction block.

PostgreSQL functions run in the context of a transaction so they
can't execute statements that aren't allowed inside a transaction
block.  A workaround is to have the function connect to the database
via contrib/dblink (or dbi-link, or some such mechanism) and execute
the statements over that connection.  Caveat: if the function's
transaction rolls back then statements already committed over the
connection won't be rolled back.

--
Michael Fuhr

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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: SkyTools Londiste HowTo
Следующее
От: Christoph Heibl
Дата:
Сообщение: deinstallation - reinstallation on Mac OS 10.4