Re: Is this really really as designed or defined in some standard

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Magnus Hagander" <magnus(at)hagander(dot)net>
Cc: "Hannu Krosing" <hannu(at)2ndquadrant(dot)com>, "PostgreSQL-development Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is this really really as designed or defined in some standard
Date: 2008-09-01 09:15:56
Message-ID: 162867790809010215r5abd686bj6fc1ad7e6c0ae6b1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/9/1 Magnus Hagander <magnus(at)hagander(dot)net>:
> Pavel Stehule wrote:
>> Hello
>>
>> 2008/8/31 Hannu Krosing <hannu(at)2ndquadrant(dot)com>:
>>> It seems that we allow several function arguments to have same
>>> name (or is it label :)
>>>
>>> hannu=# create or replace function ff(a int, a int) returns int language
>>> plpgsql as $$begin return $1+$2; end;$$;
>>> CREATE FUNCTION
>>> hannu=# select ff(1,1);
>>> ff
>>> ----
>>> 2
>>> (1 row)
>>>
>>> hannu=# select ff(1,2);
>>> ff
>>> ----
>>> 3
>>> (1 row)
>>>
>>> hannu=# create or replace function ffa(a int, a int) returns int
>>> language plpgsql as $$begin return a + a; end;$$;
>>> CREATE FUNCTION
>>> hannu=# select ffa(1,2);
>>> ffa
>>> -----
>>> 2
>>> (1 row)
>>>
>>> Is this defined by some standard or just an oversight ?
>>>
>>
>> what is problem? You have two diferent functions. I don't see anything wrong.
>
> Take a look at the second function again. It's certainly not behaviour
> that I would expect :-) (I would expect a syntax error)

I see it now - it's really bug

Pavel

>
> //Magnus
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2008-09-01 09:47:10 Re: Auto-explain patch
Previous Message Radek Strnad 2008-09-01 09:01:39 Re: WIP patch: Collation support