Matching domains-over-enums to anyenum types

Поиск
Список
Период
Сортировка
От Ronan Dunklau
Тема Matching domains-over-enums to anyenum types
Дата
Msg-id 2808697.e9J7NaK4W3@aivenronan
обсуждение исходный текст
Ответы Re: Matching domains-over-enums to anyenum types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello,

A colleague of mine was surprised to discover the following statements raised 
an error:

postgres=# CREATE TYPE abc_enum AS ENUM ('a', 'b', 'c');
CREATE TYPE
postgres=# CREATE DOMAIN abc_domain AS abc_enum;        
CREATE DOMAIN
postgres=#  SELECT 'a'::abc_domain = 'a'::abc_domain; 
ERROR:  operator does not exist: abc_domain = abc_domain
LINE 1: SELECT 'a'::abc_domain = 'a'::abc_domain;
                               ^
HINT:  No operator matches the given name and argument types. You might need 
to add explicit type casts.

This has been already discussed a long time ago, and the idea was rejected at 
the time since there was no demand for it:


https://www.postgresql.org/message-id/flat/BANLkTi%3DaGxDbGPSF043V2K-C2vF2YzGz9w%40mail.gmail.com#da4826d2cbbaca20e3440aadb3093158

Given that we implemented that behaviour for domains over ranges and 
multiranges, I don't see the harm in doing the same for domains over enums.

What do you think ?

-- 
Ronan Dunklau





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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Windows crash / abort handling
Следующее
От: Alexander Lakhin
Дата:
Сообщение: Re: Why is src/test/modules/committs/t/002_standby.pl flaky?