Re: [HACKERS] Names that suddenly include an OID

Поиск
Список
Период
Сортировка
От Tom Ivar Helbekkmo
Тема Re: [HACKERS] Names that suddenly include an OID
Дата
Msg-id 86iuitqoa7.fsf@athene.nhh.no
обсуждение исходный текст
Ответ на Re: [HACKERS] Names that suddenly include an OID  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.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"


--ELM906585503-11559-0_

--ELM906585503-11559-0_--

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Ivar Helbekkmo
Дата:
Сообщение: Re: [HACKERS] Names that suddenly include an OID
Следующее
От: Oleg Bartunov
Дата:
Сообщение: AbortTransaction and not in in-progress state