Re: plpgsql and qualified variable names - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: plpgsql and qualified variable names
Date
Msg-id 162867790707142153j763e7e1cm7e755892bf130053@mail.gmail.com
Whole thread Raw
In response to plpgsql and qualified variable names  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>
> Anyway, I'm not writing just to point out that we have a previously
> undocumented feature.  I notice that the section on porting from Oracle
> PL/SQL mentions
>
>   You cannot use parameter names that are the same as columns that are
>   referenced in the function. Oracle allows you to do this if you qualify
>   the parameter name using function_name.parameter_name.
>

it's not supported yet?


postgres=# create or replace function foox(a integer) returns integer
as $$ begin return foox.a; end $$ language plpgsql;
CREATE FUNCTION

ostgres=# select foox(10);
ERROR:  missing FROM-clause entry for table "foox"
LINE 1: SELECT  foox.a               ^
QUERY:  SELECT  foox.a
CONTEXT:  PL/pgSQL function "foox" line 1 at return

I am sure, It's good idea - and I thing SQL/PSM specifies it too.

Regards
Pavel Stehule


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump ignore tablespaces
Next
From: "Pavel Stehule"
Date:
Subject: Re: plpgsql and qualified variable names