Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvmTf-001o83-19 for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Feb 2026 01:17:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvmTe-00H4WF-16 for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Feb 2026 01:17:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvmTd-00H4W4-2n for pgsql-bugs@lists.postgresql.org; Fri, 27 Feb 2026 01:17:10 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvmTa-00000001Ogd-3OqD for pgsql-bugs@lists.postgresql.org; Fri, 27 Feb 2026 01:17:08 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-35928defcd0so873816a91.0 for ; Thu, 26 Feb 2026 17:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772155027; cv=none; d=google.com; s=arc-20240605; b=FhpZaugV4TykmPBRw72Z/cm2UPCcGdxoOAt+XG47Nm7Sn3vZAoYe53oAGDhvKOQvMG MxV2+m2j237L9dsq20DiQRUgVYH5Sdl7/rxegYXRtghiwPQQLz1PgBKobwk/Jc0x9rpm rPPo311PFUsjc+sbE/5Ceoc+Gg43diiZAEIuCd6TvYShWA6QkxiDnFgMOLnoJhka/tqw Z3LXqOkKf1D1pxGiNpovq+geN9077rMronHpRJEmMOja6ugASu51p6hA2WUDX81TABwg Id5XPUsudUsjhvxYbQtJSdSW6g2rLl/3ql6CbsP92qxp+Q+JSDCMBhXPd+I89pOoJzns Thwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=NWiAd1+vriy4HSUGeHlpgfhFAvuvDpnpgl4ai5YPBpM=; fh=mcd4W5JNTuqQfKA1FCnQP5Ns4V3jHPOp3fhLydTbcMg=; b=ZNdzABjIBwLcnTTAFAULuY8qZSPcWqLT8f1AX+iJzdlAPcdE5Nb6UVSczd9gOqBMxE b1qnsTlPCQquDa4nOR9zx27bslRXv0zeRdaMRhTLq/oY3Co+VcMYRkAfpV8IWMnzicOr TUG5WpIdjSrh05n85MAwFjQ6OHpLtnS09arExdw5+srnb2KKGF5N6/fGHH2E1+ijkuic 4yUB/iZz0UlXrimDiPnfV8inwEU9GJCIAvDVwgiV19jE7sHOZsZi79nC3DojujbHtoc/ a3AAwszhMgvSQiwA43aKTaoqlq5F6wLe0O0qo5wHpBdrd8ER8uQELpXGCOOP+vkFgoiX LIyg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772155027; x=1772759827; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NWiAd1+vriy4HSUGeHlpgfhFAvuvDpnpgl4ai5YPBpM=; b=UyMHXgBEK9WFeA+SdIn1SJ5FVLindpzzcNKO3tfFFy6p+5ARoXlv+vvYulADdvZu/b w4QVQuI75NK4QW6yUuqb6zj6FT6Ri+exNtUqC6giFW9+sSrR4XybrbTtpfb2hfTKvfVl 9Y7Sr17eaC+kNJC7jeTbWh11z44fpOkjaKqzdhHRRquAvd2quiMBct+B3SibNZ/YukUw fNaxjS/NGDNL0rUw1myaEH/rtWAWlmrBZ5hGE0QS+iWy62FNsaMjkzo6rC/58RAL2Z/8 dJ/nLVmrXL/bYh4H5uviwphAE2o1Z2v9bKBzBu9pamU54oFjqQAoYUVTVNkZwnlu3c4V y1/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772155027; x=1772759827; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NWiAd1+vriy4HSUGeHlpgfhFAvuvDpnpgl4ai5YPBpM=; b=pSNw/zoKPemEWWIZTAyEqz0mBLpr+Vis78kNZo8tIIbBMMsUaxkanO3WzJABPaPJPq Z7eLEzcSNDo1XfG6Tccn/kHNflWG1VDxIUqZ8e8p+EPpFjAC0U/wzms6GUfaVdolBzpx xyWziumW1vlCiXzmt4miX0ISpK4LNRzetHrSVDwcgMHRvnyF9Hsfxd0uJKxTKLQ6/Jb1 vzU9LjTTsYpJQrOOUI2s2Eep8Gb5HYr3evmydNNK5UwRj/vUQf6pNviAtxbAoBOtkpg3 37W6K9VsxnHgAAaVb7MAAXQoxZC6r/L5YHupqC9WlCwP907BnMmgN9OyggF5hnNaudR2 W/jg== X-Gm-Message-State: AOJu0YyIXfAPWa9Mrk4r1VKaLAGtMfltf35fOkAzY4w4zzp5awOcovOS /1JV8VDlKacKFUOJ3rl8iXyfnemkZvq/GmAXpsLWecnumni+T2J88W/TQerIjIfhmTIDqzAyzUX /hDrfDWNyUdeBwsK3924ABlEC47HZOYc= X-Gm-Gg: ATEYQzzM0uXxXsf9HlMeaYsxe7ESRdo6hoyfDYP7Pqd76+b+6fin36AFAXpyPbUAD1R 4mnQhoME6lDO3m4dHYglsOCtnoN3RjJpHrMO2SRElg4LlGWfHz+TaavRe9M1/VaJiqMwm/9nxoW aUsTvjiMeAIyVKFMFrENsacQ2Dn1FZ7maxLwzZkbHhQ2Amw88XqgP52+3vzbwQL7B9VXy90Xgsv KY/333g23TUZcLRMz0xN8/QTkq4LqST9dDl1ELLliFuzvSjWQBMaBtM6DWMNsuSicwlAidWyZZn xV9WD/jv X-Received: by 2002:a17:90b:1b45:b0:352:f2a6:334 with SMTP id 98e67ed59e1d1-35965c9c9a0mr974911a91.16.1772155026921; Thu, 26 Feb 2026 17:17:06 -0800 (PST) MIME-Version: 1.0 References: <19417-401f33ed14f3d4d5@postgresql.org> In-Reply-To: From: yuanchao zhang Date: Fri, 27 Feb 2026 09:16:56 +0800 X-Gm-Features: AaiRm50-rD3dU0QZKExuTLw7PEE94pkLg95QY-njMUES0mI8l15SCNj_n0i12es Message-ID: Subject: Re: BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric') To: "David G. Johnston" Cc: pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000ddde75064bc3fec0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ddde75064bc3fec0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=EF=BC=8C yuanchao zhang David G. Johnston =E4=BA=8E2026=E5=B9=B42=E6= =9C=8827=E6=97=A5=E5=91=A8=E4=BA=94 00:13=E5=86=99=E9=81=93=EF=BC=9A > On Thu, Feb 26, 2026 at 8:43=E2=80=AFAM PG Bug reporting form < > noreply@postgresql.org> wrote: > >> The following bug has been logged on the website: >> >> Bug reference: 19417 >> Logged by: yuanchao zhang >> Email address: zhangyc0706@gmail.com >> PostgreSQL version: 18.2 >> Operating system: windows 10 >> Description: >> >> Because I checked the documentation regarding the use of '\dD', and ther= e >> was no explanation for this special case. >> >> > Because it is not a special case of \dD specifically but a behavior of ho= w > 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 = =E2=80=94 > 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 t= he > 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 explic= it > 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-SE= ARCH-PATH > > David J. > > --000000000000ddde75064bc3fec0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you for your reply.
Okay, I understand the r= eason you mentioned. However, as a user (especially a novice user), when th= ey create a domain, they can't directly display their object. Perhaps t= he user doesn't understand this internal mechanism of PostgreSQL. The &= #39;\dD' manual states, "By default, only user-created objects are= shown." I think this means that user-created objects will be displaye= d. Therefore, when a built-in object appears in the search path before a us= er-created object, the user-created object should be displayed. This is bec= ause the user-created object is a domain object, which doesn't belong t= o 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 t= he illusion that the object wasn't created successfully. This also appl= ies to other '\d' commands. Alternatively, we could explicitly expl= ain the object display mechanism in the command's help documentation, o= r there are other ways to avoid this.
Thank you.

Best regards=EF=BC=8C
yuanchao zhang

David G. Johnston <david= .g.johnston@gmail.com> =E4=BA=8E2026=E5=B9=B42=E6=9C=8827=E6=97=A5= =E5=91=A8=E4=BA=94 00:13=E5=86=99=E9=81=93=EF=BC=9A
On Thu, Feb 26, 2026 a= t 8:43=E2=80=AFAM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:=C2=A0 =C2=A0 =C2=A0 19417
Logged by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 yuanchao zhang
Email address:=C2=A0 =C2=A0 =C2=A0 zhangyc0706@gmail.com
PostgreSQL version: 18.2
Operating system:=C2=A0 =C2=A0windows 10
Description:=C2=A0 =C2=A0 =C2=A0 =C2=A0

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.=C2=A0 This behavior is documented u= nder Patterns (here, the absence of specifying any pattern):

''""
Whenever the pattern parameter is omi= tted completely, the \d commands display all objects that are visible in th= e current schema search path =E2=80=94 this is equivalent to using * as the= pattern. (An object is said to be visible if its containing schema is in t= he search path and no object of the same kind and name appears earlier in t= he search path. This is equivalent to the statement that the object can be = referenced by name without explicit schema qualification.)
"&= quot;"

Your new domain is not visible since the p= lain type numeric in pg_catalog is implicitly first in the default search_p= ath.


David J.

--000000000000ddde75064bc3fec0--