Re: ERROR: copyObject: don't know how to copy 611

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Shane McEneaney" <shane(at)shadowbox(dot)ie>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ERROR: copyObject: don't know how to copy 611
Date: 2000-11-27 15:33:18
Message-ID: 10863.975339198@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Shane McEneaney" <shane(at)shadowbox(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-11-27 15:44:32 Re: Bad performing DELETE
Previous Message Palle Girgensohn 2000-11-27 15:02:04 Re: CREATE OR REPLACE VIEW