Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eARFXAt49046 for ; Mon, 27 Nov 2000 10:33:10 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eARFXJw10866; Mon, 27 Nov 2000 10:33:19 -0500 (EST) To: "Shane McEneaney" cc: pgsql-sql@postgresql.org Subject: Re: ERROR: copyObject: don't know how to copy 611 In-reply-to: <001701c05859$c3d454e0$49dc7ac0@gamesnow.ie> References: <001701c05859$c3d454e0$49dc7ac0@gamesnow.ie> Comments: In-reply-to "Shane McEneaney" message dated "Mon, 27 Nov 2000 10:06:50 +0000" Date: Mon, 27 Nov 2000 10:33:18 -0500 Message-ID: <10863.975339198@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200011/239 X-Sequence-Number: 270 "Shane McEneaney" 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