From: Gerald Gutierrez <pozix@home.com>
To: pgsql-sql@postgresql.org
Date: Sat, 03 Mar 2001 20:37:42 -0800
Message-ID: <5.0.2.1.0.20010303203239.02a139c8@mail.rchmd1.bc.wave.home.com> (raw)
I don't seem to be able to create tables (persistent or temporary) from
within a PL/PGSQL function. With the following script, I can create the
function fine:
CREATE FUNCTION tst()
RETURNS INTEGER
AS '
BEGIN
CREATE TABLE ttt(a int);
RETURN 0;
END;
'
LANGUAGE 'plpgsql';
... but when I execute it , I get the following error. The error happens
regardless of whether I use CREATE TABLE or CREATE TEMPORARY TABLE:
t1=> \i tst.sql
DROP
CREATE
t1=> select tst();
ERROR: copyObject: don't know how to copy 611
Is it somehow wrong to create tables from within a PL/PGSQL function?
Incidently, is it possible to generate a guaranteed unique table name while
creating tables, much like some UNICES' ability to generate guaranteed
unique file names for tempoary files?
Thanks.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: pozix@home.com
Subject: Re:
In-Reply-To: <5.0.2.1.0.20010303203239.02a139c8@mail.rchmd1.bc.wave.home.com>
References: <5.0.2.1.0.20010303203239.02a139c8@mail.rchmd1.bc.wave.home.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox