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

From Tom Lane
Subject Re: Create table in functions
Date
Msg-id 28327.967044666@sss.pgh.pa.us
Whole thread Raw
In response to Create table in functions  (Andreas Tille <tillea@rki.de>)
Responses RE: Create table in functions  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
List pgsql-sql
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.

I believe you could make this work in 7.0 by using an SQL function
instead of plpgsql, if that helps any...
        regards, tom lane


pgsql-sql by date:

Previous
From: Andreas Tille
Date:
Subject: Create table in functions
Next
From: Jan Wieck
Date:
Subject: Re: Using SETOF in plpgsql function