pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Graham Vickrage <graham@digitalplanit.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: SQL For smarties
Date: Wed, 20 Feb 2002 11:15:51 -0800 (PST)
Message-ID: <20020220111526.A2906-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <NDBBJABDILOPAOOMFJHOGEAMDEAA.graham@digitalplanit.com>


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.




view thread (8+ messages)  latest in thread

Message-ID: <20020220111526.A2906-100000@megazone23.bigpanda.com>
Permalink:  ../20020220111526.A2906-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020220111526.A2906-100000@megazone23.bigpanda.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, graham@digitalplanit.com
  Subject: Re: SQL For smarties
  In-Reply-To: <20020220111526.A2906-100000@megazone23.bigpanda.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