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

From Tom Lane
Subject Re: BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric')
Date
Msg-id 644541.1772122694@sss.pgh.pa.us
Whole thread Raw
In response to 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>)
List 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 by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric')
Next
From: Tom Lane
Date:
Subject: Re: pg_get_viewdef() produces non-round-trippable SQL for views with USING join on mismatched integer types