Re: plpgsql and qualified variable names

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: plpgsql and qualified variable names
Date: 2007-07-15 04:53:30
Message-ID: 162867790707142153j763e7e1cm7e755892bf130053@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2007-07-15 05:00:03 Re: plpgsql and qualified variable names
Previous Message Tom Lane 2007-07-15 02:56:33 Re: pg_dump ignore tablespaces