Laurent HERVE <laurent_herve@infonie.fr> writes:
> create function TEST (char(5),char(6),char(11))
> returns boolean
> as '
> DECLARE
> bank alias for $1;
> guichet alias for $2;
> compte alias for $3;
^^^^^^
> cmpt record;
> BEGIN
> raise notice ''Banque %'',bank;
> select into cmpt * from compte;
^^^^^^
> return ''t'';
> END;'
> LANGUAGE 'plpgsql';
> ERROR: parser: parse error at or near "$1"
> It doesn't happen with another table than ''compte''.
You've used compte as the name of a parameter in the function,
so the SELECT gets transformed to
select into cmpt * from $3;
which won't work. (Although I'd have expected the error message
to complain about $3 not $1 ... hmm ... maybe something else is
going on here?)
regards, tom lane