Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e7NFVtN57324 for ; Wed, 23 Aug 2000 11:31:55 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id LAA28330; Wed, 23 Aug 2000 11:31:06 -0400 (EDT) To: Andreas Tille cc: PostgreSQL SQL Subject: Re: Create table in functions In-reply-to: References: Comments: In-reply-to Andreas Tille message dated "Wed, 23 Aug 2000 16:49:31 +0200" Date: Wed, 23 Aug 2000 11:31:06 -0400 Message-ID: <28327.967044666@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200008/253 Andreas Tille 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