Skip site navigation (1) Skip section navigation (2)

Re: Is this really really as designed or defined in somestandard

From: David Fetter <david(at)fetter(dot)org>
To: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is this really really as designed or defined in somestandard
Date: 2008-08-31 22:22:07
Message-ID: 20080831222207.GH3717@fetter.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Mon, Sep 01, 2008 at 12:55:21AM +0300, Hannu Krosing wrote:
> It seems that we allow several function arguments to have same 
> name (or is it label :)

Ugh!

> 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 ?

This looks like a bug.

Cheers,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

pgsql-hackers by date

Next:From: David RowleyDate: 2008-08-31 22:50:51
Subject: Re: TODO item: Implement Boyer-Moore searching (First time hacker)
Previous:From: Marko KreenDate: 2008-08-31 22:17:38
Subject: [PATCH] In case module has wrong magic, report exact problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group