Casting macaddr types to text

Поиск
Список
Период
Сортировка
От Mayers, Philip J
Тема Casting macaddr types to text
Дата
Msg-id A0F836836670D41183A800508BAF190B35E2E4@icex1.cc.ic.ac.uk
обсуждение исходный текст
Список pgsql-general
I'm trying to do this:

hdb=> select * from interface where mac like '08:%';
ERROR:  Unable to identify an operator '~~' for types 'macaddr' and
'unknown'
        You will have to retype this query using an explicit cast

There's no like operator (~~) defined for mac. Ok, fine. *BUT*, nor is there
a cast to text either:

hdb=> select * from interface where mac::text like '08:%';
ERROR:  Cannot cast type 'macaddr' to 'text'

Why? It seems clear to me that there is a well-defined cast to text type,
and in the absence of a like operator...

Advice?

Regards,
Phil

+----------------------------------+
| Phil Mayers, Network Support     |
| Centre for Computing Services    |
| Imperial College                 |
+----------------------------------+

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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: : Execute a string of command in sql'script
Следующее
От: Guillaume Lémery
Дата:
Сообщение: Limited rights for a user