Re: mac.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: mac.c
Дата
Msg-id 6320.965663850@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: mac.c  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
Ответы Re: mac.c  (Don Baccus <dhogaza@pacifier.com>)
Список pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> Why not implement like() and notlike() for macaddr data types which (if
> both args are macaddr) will compare on manufacturer's fields alone? That
> would seem to get all the functionality you might want.

That seems like an entirely unjustified overloading of the "LIKE"
operator.  I don't see any reason why someone would expect a string-
pattern-match operator to have the semantics of "compare the
manufacturer part only" when applied to macaddr.

> That would avoid ginning up something artificial like a macaddr with
> some fields zeroed out.

If you don't like that, provide a function that extracts the
manufacturer part as a text string (and I guess another to extract the
low-order bits as text).  Then a lookup to get the manufacturer name can
be done as a text-field search.  There is plenty of precedent in the
inet/cidr functions for extracting portions of a data value as text
strings.
        regards, tom lane


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

Предыдущее
От: Thomas Swan
Дата:
Сообщение: UNIONS
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: Re: [GENERAL] Trouble with float4 after upgrading from 6.5.3 to 7.0.2