public inbox for [email protected]
help / color / mirror / Atom feedFrom: yuanchao zhang <[email protected]>
To: David G. Johnston <[email protected]>
Cc: [email protected]
Subject: Re: BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric')
Date: Fri, 27 Feb 2026 09:16:56 +0800
Message-ID: <CAADcJZM9rBgPVXQp2WOKx69YvVfoWRPpqRpgFnBxiSX45JACfw@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwb0SLTxUMUxgE=xegwzwAGXqYJ61McLexszb-vTa4y=Mg@mail.gmail.com>
References: <[email protected]>
<CAKFQuwb0SLTxUMUxgE=xegwzwAGXqYJ61McLexszb-vTa4y=Mg@mail.gmail.com>
Thank you for your reply.
Okay, I understand the reason you mentioned. However, as a user (especially
a novice user), when they create a domain, they can't directly display
their object. Perhaps the user doesn't understand this internal mechanism
of PostgreSQL. The '\dD' manual states, "By default, only user-created
objects are shown." I think this means that user-created objects will be
displayed. Therefore, when a built-in object appears in the search path
before a user-created object, the user-created object should be displayed.
This is because the user-created object is a domain object, which doesn't
belong to the same type as built-in objects in pg_type (domain type is 'd',
while built-in types use 'b'). Otherwise, it might give the user the
illusion that the object wasn't created successfully. This also applies to
other '\d' commands. Alternatively, we could explicitly explain the object
display mechanism in the command's help documentation, or there are other
ways to avoid this.
Thank you.
Best regards,
yuanchao zhang
David G. Johnston <[email protected]> 于2026年2月27日周五 00:13写道:
> On Thu, Feb 26, 2026 at 8:43 AM PG Bug reporting form <
> [email protected]> wrote:
>
>> The following bug has been logged on the website:
>>
>> Bug reference: 19417
>> Logged by: yuanchao zhang
>> Email address: [email protected]
>> PostgreSQL version: 18.2
>> Operating system: windows 10
>> Description:
>>
>> Because I checked the documentation regarding the use of '\dD', and there
>> was no explanation for this special case.
>>
>>
> Because it is not a special case of \dD specifically but a behavior of how
> all the \d meta-commands function. This behavior is documented under
> Patterns (here, the absence of specifying any pattern):
>
> ''""
> 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.)
> """
>
> Your new domain is not visible since the plain type numeric in pg_catalog
> is implicitly first in the default search_path.
>
> https://www.postgresql.org/docs/current/app-psql.html
>
> https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-SEARCH-PATH
>
> David J.
>
>
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric')
In-Reply-To: <CAADcJZM9rBgPVXQp2WOKx69YvVfoWRPpqRpgFnBxiSX45JACfw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox