Received: from datasoft.com (maniac.datasoft.com [63.228.155.187]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5QJwsa45412 for ; Tue, 26 Jun 2001 15:58:54 -0400 (EDT) (envelope-from kristis.makris@datasoft.com) Message-Id: <200106261958.f5QJwsa45412@postgresql.org> Received: (qmail 29863 invoked from network); 26 Jun 2001 19:58:51 -0000 Received: from dsco-user.datasoft.com (HELO leonidas.corp.datasoft.com) (63.228.155.190) by maniac.datasoft.com with SMTP; 26 Jun 2001 19:58:51 -0000 Subject: Re: Using the extract() function in plpgsql From: Kristis Makris To: Richard Huxton Cc: pgsql-sql@postgresql.org In-Reply-To: <003701c0fa5e$722570a0$1001a8c0@archonet.com> References: <200106202233.f5KMXSa91452@postgresql.org> <003701c0fa5e$722570a0$1001a8c0@archonet.com> Content-Type: text/plain X-Mailer: Evolution (0.9/+cvs.2001.03.14.20.47 - Preview Release) Date: 26 Jun 2001 12:58:51 -0700 Mime-Version: 1.0 X-Archive-Number: 200106/422 X-Sequence-Number: 3719 On 21 Jun 2001 15:28:29 +0100, Richard Huxton wrote: > From: "Kristis Makris" > > > Hi Peter, > > > > Thanks for looking into this. I tried the CREATE TABLE AS syntax within > > an EXECUTE command but I still get the same error message. The CREATE > > TABLE AS docs mention that this syntax is "functionalily equivalent" to > > the SELECT INTO, so it's no surprise that I get the same error message: > > > > NOTICE: The execStmt is: CREATE TEMPORARY TABLE test AS SELECT > > extract(epoch from interval '62 days 22:30:48') > > ERROR: EXECUTE of SELECT ... INTO is not implemented yet > > In the example above you can just CREATE the table then INSERT into it - > avoids the whole issue. Is the example accurate? > > - Richard Huxton Creating the temporary table first, and then inserting into it seems to be a *somehow* functional workaround. However, the function cannot be called again a second time during the same session, since the temporary table already exists. Is there a way a table can be created truly temporary, existing only within the scope of a plpgsql function?