Re: ERROR: $1 is declared CONSTANT in plpgsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hans Plum <plum(at)giub(dot)uni-bonn(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: ERROR: $1 is declared CONSTANT in plpgsql
Date: 2002-05-07 14:40:31
Message-ID: 23464.1020782431@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hans Plum <plum(at)giub(dot)uni-bonn(dot)de> writes:
> DECLARE
> InpAscii ALIAS FOR $1;
> BEGIN
> InpAscii := $1;

> NOTICE: plpgsql: ERROR during compile of f_ascii2html near line 7
> ERROR: $1 is declared CONSTANT

You can't assign to a function's input parameters. That first
assignment is useless as well as incorrect (if it were allowed,
it'd effectively be $1 := $1, because of your ALIAS).

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Oliver Elphick 2002-05-07 14:50:42 Re: ERROR: $1 is declared CONSTANT in plpgsql
Previous Message Joshua b. Jore 2002-05-07 14:29:13 Re: Cascaded updates / deletes don't work on inherited