Re: Creating new table with a function?

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: Creating new table with a function?
Дата
Msg-id 20140816141839.GA2363@tux
обсуждение исходный текст
Ответ на Creating new table with a function?  (Csányi Pál <csanyipal@gmail.com>)
Список pgsql-novice
Csányi Pál <csanyipal@gmail.com> wrote:

> Hi,
>
> Is it possible to create a new table with help of a function?
>
> I want to create a new table in my database by using a function that
> get datas from existing tables so it can to create a new table with
> fields.
>
> Can one create such function?
> If the answer is yes, then how can one do this?
> Where is described in documentation creating such custom functions?

Sure, you can.

http://www.postgresql.org/docs/9.3/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

40.5.4. Executing Dynamic Commands


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


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

Предыдущее
От: Csányi Pál
Дата:
Сообщение: Creating new table with a function?
Следующее
От: Marc Richter
Дата:
Сообщение: Re: Upgrading from PG 8.2.5 to 9.1.13