Strange error with Pl/PgSQL - Mailing list pgsql-novice

From Laurent HERVE
Subject Strange error with Pl/PgSQL
Date
Msg-id 3A1FB9E5.EC0D227A@infonie.fr
Whole thread Raw
Responses Re: Strange error with Pl/PgSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
I wrote a little test function in pl/pgsql :

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;
--              where code_banque=bank
--              and numero_guichet=guichet
--              and numero_compte=compte;
                return ''t'';
END;'
LANGUAGE 'plpgsql';

When using this function I get the following error :
z_money=> select test('99999','00001','1');
ERROR:  parser: parse error at or near "$1"

It doesn't happen with another table than ''compte''. It looks like
there is something wrong with table ''compte'', but I still can do
selects, inserts, etc... with psql.
If I suppress parameters, the error message does not happen.

So what's wrong ? How can I found more information ?

Thanks for advance.



pgsql-novice by date:

Previous
From: Mike Castle
Date:
Subject: Re: tinterval or interval
Next
From: Tom Lane
Date:
Subject: Re: Strange error with Pl/PgSQL