Re: create a table inside a function

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: create a table inside a function
Дата
Msg-id 20090625130748.GA24456@depesz.com
обсуждение исходный текст
Ответ на create a table inside a function  (Alain Roger <raf.news@gmail.com>)
Список pgsql-general
On Thu, Jun 25, 2009 at 02:53:59PM +0200, Alain Roger wrote:
> i would like to execute the following SQL command into a function based on
> some IF, END IF tests before.
> how can i do that ?

1. you can use execute in pl/pgsql.
2. if your ifs are basically testing if the table exists - you might
want to check this:
http://www.depesz.com/index.php/2008/06/18/conditional-ddl/

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: [BUGS] Integrity check
Следующее
От: Alain Roger
Дата:
Сообщение: Re: create a table inside a function