Re: BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric')

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric')
Дата
Msg-id 644541.1772122694@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric')  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> I created a domain object named `numeric` using the following SQL:
> `CREATE DOMAIN numeric AS NUMERIC(12,2) DEFAULT 0 CHECK (VALUE >= 0);`
> After executing this SQL, it indicated that the domain was created
> successfully.
> However, when I executed `\dD` in psql, I found that the domain I just
> created could not be displayed.

This is expected, because that domain will be behind the built-in
"numeric" type: pg_catalog.numeric comes ahead of public.numeric
in the default search_path.  As the psql documentation explains:

    Whenever the pattern parameter is omitted completely, the \d
    commands display all objects that are visible in the current
    schema search path — this is equivalent to using * as the
    pattern. (An object is said to be visible if its containing schema
    is in the search path and no object of the same kind and name
    appears earlier in the search path. This is equivalent to the
    statement that the object can be referenced by name without
    explicit schema qualification.) To see all objects in the database
    regardless of visibility, use *.* as the pattern.

So you'd see the domain if you wrote

\dD *.*

or

\dD public.*

            regards, tom lane



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