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 1vve4C-00BjMD-2e for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Feb 2026 16:18:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vve4B-00E6i0-2W for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Feb 2026 16:18:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vve4B-00E6Vi-1g for pgsql-bugs@lists.postgresql.org; Thu, 26 Feb 2026 16:18:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vve47-00000001Q4F-3SO5 for pgsql-bugs@lists.postgresql.org; Thu, 26 Feb 2026 16:18:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 61QGIEmA644542; Thu, 26 Feb 2026 11:18:14 -0500 From: Tom Lane To: zhangyc0706@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric') In-reply-to: <19417-401f33ed14f3d4d5@postgresql.org> References: <19417-401f33ed14f3d4d5@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 26 Feb 2026 07:21:05 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <644540.1772122694.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 26 Feb 2026 11:18:14 -0500 Message-ID: <644541.1772122694@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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