Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (8.11.6/8.11.4) with ESMTP id g1KJFqF90693 for ; Wed, 20 Feb 2002 14:15:53 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 04E1ED5FF; Wed, 20 Feb 2002 11:15:51 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id E676B5BF9; Wed, 20 Feb 2002 11:15:51 -0800 (PST) Date: Wed, 20 Feb 2002 11:15:51 -0800 (PST) From: Stephan Szabo To: Graham Vickrage Cc: Subject: Re: SQL For smarties In-Reply-To: Message-ID: <20020220111526.A2906-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200202/258 X-Sequence-Number: 6681 On Wed, 20 Feb 2002, Graham Vickrage wrote: > I am trying to create tables from within a funtion i.e. > > create function _tree_create(text) retuns int as ' > begin; > create table $1_tree (....); > return 1; > end; > ... > > select _tree_create('item'); > > An error message refering to $1 gets thrown up. Is this not possible to do > or is there another way of doing it? You'll probably need to generate the query string you want to run and use execute.