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 1vvdEP-00B6gr-0n for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Feb 2026 15:24:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvcsP-00DZll-1k for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Feb 2026 15:02:05 +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 1vvVhH-00AbQj-0l for pgsql-bugs@lists.postgresql.org; Thu, 26 Feb 2026 07:22:07 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vvVhE-00000001FpH-0c3H for pgsql-bugs@lists.postgresql.org; Thu, 26 Feb 2026 07:22:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=LlQ/al0l4gmbcdi6UspCHBdMTQnuBmEtwzRdXtrz0pw=; b=pnKRgm0nP0THRpE++Ph+LDUcwX BItQlMALdE/IYCwdsLgM6vhdMHQbGUhAIHEl/n6afvH9Lfc6D1/0SSgzCGRPKCLkG12LI3NxoFwAM 9gQLsjVw/l1KA+t8qcFmpMP/uBnTjZ92WUz7avNg8Azdrw+hxFkj866mFJi6x0joZue6vymIcaK2Z rdvzirI6nFOKOT/T292VpptMu5cBFGOfZrPqQOHApQFqkSmb8lHGEQgIky0zO6LmkkOtGS7e5Wznv LAMCBjMG5wWlmTBLhSZOXBUErRH5KjHKdoQmBDryCA5K3CIEVvDdTzW8MDFNMvfDF/+Dw8YaMcscN Am02XJeg==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvVhE-003i7N-1C for pgsql-bugs@lists.postgresql.org; Thu, 26 Feb 2026 07:22:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvVhD-00C7Cz-2I for pgsql-bugs@lists.postgresql.org; Thu, 26 Feb 2026 07:22:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19417: '\dD' fails to list user-defined domains that shadow built-in type names (e.g., 'numeric') To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: zhangyc0706@gmail.com Reply-To: zhangyc0706@gmail.com, pgsql-bugs@lists.postgresql.org Date: Thu, 26 Feb 2026 07:21:05 +0000 Message-ID: <19417-401f33ed14f3d4d5@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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: =20 Hi, I created a domain object named `numeric` using the following SQL: `CREATE DOMAIN numeric AS NUMERIC(12,2) DEFAULT 0 CHECK (VALUE >=3D 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. Therefore, I queried `pg_type` using the following statement: `SELECT n.nspname AS schema_name, t.typname AS domain_name, pg_catalog.format_type(t.typbasetype, t.typtypmod) AS base_type, t.typnotnull AS not_null, t.typdefault AS default_value, t.typtype FROM pg_catalog.pg_type t JOIN pg_catalog.pg_namespace n ON n.oid =3D t.typnamespace WHERE t.typtype =3D 'd' ORDER BY schema_name, domain_name;` The execution result of this SQL statement shows the domain object I just created. I then created a domain using a different name, as shown in the following SQL: `CREATE DOMAIN numeric_t1 AS NUMERIC(12,2) DEFAULT 0 CHECK (VALUE >=3D 0);` After executing the SQL, I found that this domain could be shown both in `pg_type` and through a `\dD` query. Of course, I know that using the name numeric as the domain name isn't particularly reasonable, but I didn't receive any prompts during the creation process. Therefore, I think that since the creation was successful, it should be displayed via `\dD`. Because I checked the documentation regarding the use of '\dD', and there was no explanation for this special case. Thanks.