RE: Create table in functions

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема RE: Create table in functions
Дата
Msg-id 000201c00d66$3953ea80$2801007e@tpf.co.jp
обсуждение исходный текст
Ответ на Re: Create table in functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Create table in functions  (Tom Lane <tgl@sss.pgh.pa.us>)
RE: Create table in functions  (Andreas Tille <tillea@rki.de>)
Список pgsql-sql
> -----Original Message-----
> From: Tom Lane
> 
> Andreas Tille <tillea@rki.de> writes:
> > web=# create function pHelpTable( )
> > web-#   returns int
> > web-#   As '
> > web'#     Begin
> > web'#       Create Table Temp_NumTable  ( Num int ) ;
> > web'#   
> > web'#       return 17 ;
> > web'#     End; '
> > web-#   language 'plpgsql' ;
> > CREATE
> 
> The majority of utility commands don't work in plpgsql functions,
> because no one had gotten 'round to writing querytree copy routines
> for them.  Ian Turner finally did all the gruntwork for that a few
> weeks ago, so this does work in current sources and will be in 7.1.
>

Hmm,Andreas's original function seems to contain other statements.
If the function contains DML statements for the table Temp_Num_Table,
it wouldn't work properly. i.e 1st call would work but 2nd call woudn't.

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp


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

Предыдущее
От: "Franz J Fortuny"
Дата:
Сообщение: Re: Speed or configuration
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Create table in functions