Received: from sd.tpf.co.jp (IDENT:qmailr@sd.tpf.co.jp [210.161.239.34]) by hub.org (8.10.1/8.10.1) with SMTP id e7O0rq534669 for ; Wed, 23 Aug 2000 20:53:53 -0400 (EDT) Received: (qmail 30949 invoked from network); 24 Aug 2000 00:53:50 -0000 Received: from unknown (HELO cadzone) (126.0.1.40) by sd2.10.0.100.in-addr.arpa with SMTP; 24 Aug 2000 00:53:50 -0000 From: "Hiroshi Inoue" To: "Tom Lane" , "Andreas Tille" Cc: "PostgreSQL SQL" Subject: RE: Create table in functions Date: Thu, 24 Aug 2000 09:57:06 +0900 Message-ID: <000201c00d66$3953ea80$2801007e@tpf.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <28327.967044666@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Importance: Normal X-Archive-Number: 200008/258 > -----Original Message----- > From: Tom Lane > > 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. > 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