Re: Odd behavior with domains - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Odd behavior with domains
Date
Msg-id 20160624030042.GA251264@alvherre.pgsql
Whole thread Raw
In response to Odd behavior with domains  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: Odd behavior with domains  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Odd behavior with domains  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
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.

alvherre=# create domain text char(3);
CREATE DOMAIN
alvherre=# \dD             Listado de dominiosEsquema | Nombre | Tipo | Modificador | Check 
---------+--------+------+-------------+-------
(0 filas)

alvherre=# set search_path to 'public', 'pg_catalog';
SET
alvherre=# \dD                 Listado de dominiosEsquema | Nombre |     Tipo     | Modificador | Check 
---------+--------+--------------+-------------+-------public  | text   | character(3) |             | 
(1 fila)

alvherre=# reset search_path;
RESET
alvherre=# \dD             Listado de dominiosEsquema | Nombre | Tipo | Modificador | Check 
---------+--------+------+-------------+-------
(0 filas)

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: tuplesort.c's copytup_index() is dead code
Next
From: Tom Lane
Date:
Subject: Re: Odd behavior with domains