RE: Create table in functions - Mailing list pgsql-sql

From Hiroshi Inoue
Subject RE: Create table in functions
Date
Msg-id 000201c00d66$3953ea80$2801007e@tpf.co.jp
Whole thread Raw
In response to Re: Create table in functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Create table in functions  (Tom Lane <tgl@sss.pgh.pa.us>)
RE: Create table in functions  (Andreas Tille <tillea@rki.de>)
List 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 by date:

Previous
From: "Franz J Fortuny"
Date:
Subject: Re: Speed or configuration
Next
From: Tom Lane
Date:
Subject: Re: Create table in functions