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 1w7BAg-0052Q8-2r for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Mar 2026 11:52:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7BAf-002yUb-1E for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Mar 2026 11:52:41 +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 1w731t-000gFD-29 for pgsql-bugs@lists.postgresql.org; Mon, 30 Mar 2026 03:11:06 +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 1w731s-00000001joC-1eii for pgsql-bugs@lists.postgresql.org; Mon, 30 Mar 2026 03:11:05 +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=4vSFVSDIV6eyv7ZDIqn0nLUWqZcGZiXgjvgg2haSpx4=; b=quqVB2u0dcu2397qSI2tkMAhe+ IxemeG1g1NITmJzHk4dcHgZ7v4kaPm1FIPZ/Tp5ROXME9K8sYRkHrcaCkGrXI1A28DCqsio6T1MEE OrxbaUeT5JgS0UL3ZPo0tpaFaGia+jZeCqzK/QjTePVLANPatlMxmeijhi7f8LDEAAhmV9cOyrOhI 234wYW/2GycvZoh4H3wBtysG8oxqm3RGljyX7Du1qT49m3JgqGxZ96txViFh7FZfk8JJQojGiWDMV UM9YAZQ6wgeXez3vtHkhCc+HXaYuOCH7WNZzvufQ9761ns/uQQAqoeWHZ4RlbXfX9oVAqa5Z/t2zj 5Qj6QUrA==; 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 1w731r-006Z9x-2l for pgsql-bugs@lists.postgresql.org; Mon, 30 Mar 2026 03:11:04 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w731q-00ADVc-0L for pgsql-bugs@lists.postgresql.org; Mon, 30 Mar 2026 03:11:02 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19444: conkey field empty for domain NOT NULL constraint in pg_constraint (18.3) To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: zheng_xianghang@163.com Reply-To: zheng_xianghang@163.com, pgsql-bugs@lists.postgresql.org Date: Mon, 30 Mar 2026 03:10:45 +0000 Message-ID: <19444-21f73da373fc0f58@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: 19444 Logged by: Xianghang Zheng Email address: zheng_xianghang@163.com PostgreSQL version: 18.3 Operating system: Linux x86_64 Description: =20 When creating a domain with a NOT NULL constraint, the conkey field in pg_constraint remains empty. This is inconsistent with table-level NOT NULL constraints, which correctly populate the conkey field. Version: PostgreSQL 18.3 (x86_64) Platform: Linux x86_64 Steps to Reproduce: ------------------- CREATE DOMAIN my_domain AS text NOT NULL; SELECT conname, contype, conkey, contypid::regtype FROM pg_constraint WHERE contypid =3D 'my_domain'::regtype; Actual Result: -------------- conname | contype | conkey | contypid --------------------+---------+--------+----------- my_domain_not_null | n | | my_domain (1 row) Expected Result: ---------------- The conkey field should contain {1} (the first and only column of the domain): conname | contype | conkey | contypid --------------------+---------+--------+----------- my_domain_not_null | n | {1} | my_domain Additional Information: ----------------------- - The NOT NULL constraint works correctly (rejects NULL values) - The issue is only with the system catalog metadata - This may affect tools like pg_dump, pg_upgrade, or extensions that rely on the conkey field for domain constraints - Table-level NOT NULL constraints correctly populate conkey: =20 CREATE TABLE test_table (id text NOT NULL); SELECT conname, contype, conkey FROM pg_constraint WHERE conrelid =3D 'test_table'::regclass; =20 Result: test_table_id_not_null | n | {1} Please let me know if you need any additional information or testing.