Received: from rmx614-mta.mail.com (rmx614-mta.mail.com [165.251.48.52]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA13924 for ; Fri, 19 May 2000 10:28:06 -0400 (EDT) (envelope-from skwny@email.com) Received: from web14.mail.com (web14.mail.com [165.251.32.24]) by rmx614-mta.mail.com (8.9.3/8.9.3) with SMTP id KAA19250 for ; Fri, 19 May 2000 10:28:05 -0400 (EDT) Message-ID: <383872133.958746482309.JavaMail.root@web14.mail.com> Date: Fri, 19 May 2000 10:28:02 -0400 (EDT) From: Scott Wood To: pgsql-sql@postgresql.org Subject: Creating Tables in Functions Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: mail.com X-Originating-IP: 208.10.179.233 X-Archive-Number: 200005/79 All, I am trying to create a function that will create a temporary table and fill that table with data. Here is my function definition below (much simplified for this discussion): create function my_function() returns int4 as' create temp table my_table(a integer); insert into my_table values (1); ' language 'sql'; When I try to create this function, I always get the error: ERROR: Relation 'my_table' does not exist Of course if doesn't exist, I haven't created it yet! What am I doing wrong? I am using 7.0. Thanks in advance for any help. Scott skwny@email.com ----------------------------------------------- FREE! The World's Best Email Address @email.com Reserve your name now at http://www.email.com