Re: Am I entering a world of pain...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: aled(at)tesco(dot)net
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Am I entering a world of pain...
Date: 2003-08-12 23:00:55
Message-ID: 17726.1060729255@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Aled Morris <aled(at)tesco(dot)net> writes:
> create or replace function droptable (varchar(255)) returns void as '
> begin
> drop table $1;
> return;
> end;
> ' language 'plpgsql';

Try
execute ''drop table '' || $1;
instead. See the plpgsql manual's overview for an explanation why you
can't use variables as table/field names except through EXECUTE.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message glenn 2003-08-13 03:04:28 VI key strokes
Previous Message Stephan Szabo 2003-08-12 22:52:49 Re: Am I entering a world of pain...