From: Tom Lane <tgl@sss.pgh.pa.us>
To: Shane McEneaney <shane@shadowbox.ie>
Cc: pgsql-sql@postgresql.org
Subject: Re: ERROR: copyObject: don't know how to copy 611
Date: Mon, 27 Nov 2000 10:33:18 -0500
Message-ID: <10863.975339198@sss.pgh.pa.us> (raw)
In-Reply-To: <001701c05859$c3d454e0$49dc7ac0@gamesnow.ie>
References: <001701c05859$c3d454e0$49dc7ac0@gamesnow.ie>
"Shane McEneaney" <shane@shadowbox.ie> writes:
> I get the error ERROR: copyObject: don't know how to copy 611
> when I try to run the following procedure. The create table is causing
> the problem.
> CREATE FUNCTION "my_func" (int8) RETURNS int8 AS '
> declare
> v_my_var ALIAS FOR $1;
> begin
> create table my_table(my_id int);
> end;
> ' LANGUAGE 'plpgsql';
> Can anybody explain this?
CREATE TABLE, like most other utility statements, isn't supported by
plpgsql at present. This is fixed for 7.1 to the extent that you can
do examples like the above, but you still can't pass parameters to
the things --- for example CREATE TABLE $1 (foo int) won't work.
For these sorts of things you might want to consider pltcl or plperl,
which don't attempt to do any pre-parsing of SQL statements. A little
slower, but much more flexible...
regards, tom lane
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: tgl@sss.pgh.pa.us, shane@shadowbox.ie
Subject: Re: ERROR: copyObject: don't know how to copy 611
In-Reply-To: <10863.975339198@sss.pgh.pa.us>
References: <001701c05859$c3d454e0$49dc7ac0@gamesnow.ie> <10863.975339198@sss.pgh.pa.us>
* 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