Re: Is this really really as designed or defined in some standard - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: Is this really really as designed or defined in some standard
Date
Msg-id 48BB9F62.2060102@hagander.net
Whole thread Raw
In response to Re: Is this really really as designed or defined in some standard  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Responses Re: Is this really really as designed or defined in some standard  ("Pavel Stehule" <pavel.stehule@gmail.com>)
List pgsql-hackers
Pavel Stehule wrote:
> Hello
> 
> 2008/8/31 Hannu Krosing <hannu@2ndquadrant.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)

//Magnus


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Our CLUSTER implementation is pessimal
Next
From: "Radek Strnad"
Date:
Subject: Re: WIP patch: Collation support