From: | Tom Ivar Helbekkmo <tih(at)nhh(dot)no> |
---|---|
To: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] Names that suddenly include an OID |
Date: | 1998-09-12 16:38:39 |
Message-ID: | 86iuitqoa7.fsf@athene.nhh.no |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> writes:
> OK, it was me who added it, and it still has some problems. The
> reason the oid was added is that the old code just displayed the
> pg_proc.proname for regproc fields, and the input function just
> found the FIRST function with a matching name, which is a problem
> because we can have multiple functions with the same name but
> different types.
Then the code in question should be changed to properly look for a
tuple where the name matches _and_ the types are right. Combining the
(overloaded) name and the (unique) OID into a text string seems very
inelegant to me, and intuitively very, very wrong: if names aren't
usable in a certain situation, use OIDs instead -- that's what they're
for -- but don't change the name to add (seemingly) random numbers to
make them unique.
Contrived, silly, irrelevant example to illuminate how I'm thinking:
if you used the string 'plus' to signify addition, and you decided you
had to differentiate between adding integers and adding floats, then
findfunc('plus');
should become
findfunc('plus', 'integer');
instead of forcing the programmer to write things like
findfunc('plus_234893');
or adding weird code to every use of 'plus' to look up what the silly,
composite name happens to be this time.
-tih
--
Popularity is the hallmark of mediocrity. --Niles Crane, "Frasier"
From | Date | Subject | |
---|---|---|---|
Next Message | Oleg Bartunov | 1998-09-12 19:23:28 | AbortTransaction and not in in-progress state |
Previous Message | Bruce Momjian | 1998-09-12 16:11:00 | Re: Porting effort and patches for the Irix port for PostgreSQL |