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
|
| Список | 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 по дате отправления: