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