Re: Odd behavior with domains

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: Odd behavior with domains
Дата
Msg-id 576D691F.9060601@commandprompt.com
обсуждение исходный текст
Ответ на Re: Odd behavior with domains  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Odd behavior with domains  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Odd behavior with domains  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On 06/23/2016 08:00 PM, Alvaro Herrera wrote:
> Joshua D. Drake wrote:
>> Hey,
>>
>> So this came across my twitter feed:
>>
>> https://pbs.twimg.com/media/ClqIJtmXEAA5IGt.png
>>
>> I have verified the oddness with a newer version:
>
> Well, it's not specifically related to domains -- it's related to the
> fact that pg_catalog objects mask the domain you created in the public
> schema, because pg_catalog is by default in front of all other schemas
> unless you explicitely put it elsewhere.

Yes but what makes it weird is this:

postgres=# create domain text char(3);
CREATE DOMAIN

-- cool, no problem

postgres=# create domain text char(2);
ERROR:  type "text" already exists

-- as expected

postgres=# \dD             List of domains Schema | Name | Type | Modifier | Check
--------+------+------+----------+-------
(0 rows)

-- wait what? I just created this.
-- I understand the search_path issue but:


postgres=# create domain textd char(2);
CREATE DOMAIN
postgres=# \dD                 List of domains Schema | Name  |     Type     | Modifier | Check
--------+-------+--------------+----------+------- public | textd | character(2) |          |
(1 row)

-- why would this show up without changing the search path if the
-- previous one didn't?


postgres=# drop domain text;
ERROR:  "text" is not a domain
postgres=# set search_path to 'public';
SET
postgres=# drop domain text;
ERROR:  "text" is not a domain
postgres=#

-- Now what?

Note: If this is literally just the way it is, cool. It was just as I 
was exploring this all seemed odd.

Sincerely,

JD


-- 
Command Prompt, Inc.                  http://the.postgres.company/                        +1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Everyone appreciates your honesty, until you are honest with them.



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

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: Bug in to_timestamp().
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Bug in to_timestamp().