From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Gevik Babakhani <pgdev(at)xs4all(dot)nl> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Question about FUNCDETAIL_MULTIPLE |
Date: | 2009-06-04 13:52:45 |
Message-ID: | 12964.1244123565@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Gevik Babakhani <pgdev(at)xs4all(dot)nl> writes:
> I was wondering what the philosophy is behind letting an "ambiguous"
> function be created in the first place. Is this for backwards
> compatibility or perhaps for historical reasons?
Neither; it's a feature, and one we quite like. For example, would you
really prefer that the six different versions of abs() had to have
different names?
regression=# \df abs
List of functions
Schema | Name | Result data type | Argument data types | Type
------------+------+------------------+---------------------+--------
pg_catalog | abs | bigint | bigint | normal
pg_catalog | abs | double precision | double precision | normal
pg_catalog | abs | integer | integer | normal
pg_catalog | abs | numeric | numeric | normal
pg_catalog | abs | real | real | normal
pg_catalog | abs | smallint | smallint | normal
(6 rows)
Even if you were willing to do that, what about the forty-seven
distinct versions of "+"? Overloaded operators are not fundamentally
different from overloaded functions.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2009-06-04 13:55:23 | Re: PANIC: corrupted item lengths |
Previous Message | Magnus Hagander | 2009-06-04 13:39:56 | Re: It's June 1; do you know where your release is? |