BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem.

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: msdnchina(at)163(dot)com
Subject: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem.
Date: 2025-12-10 14:51:20
Message-ID: 19351-8f1c523ead498545@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19351
Logged by: yanliang lei
Email address: msdnchina(at)163(dot)com
PostgreSQL version: 18.1
Operating system: Linux
Description:

postgres=# create table test_null_20251210(c1 int not null,c2 text);
CREATE TABLE
postgres=# \d+ test_null_20251210
数据表 "public.test_null_20251210"
栏位 | 类型 | 校对规则 | 可空的 | 预设 | 存储 | 压缩 | 统计目标 | 描述
------+---------+----------+----------+------+----------+------+----------+------
c1 | integer | | not null | | plain | | |
c2 | text | | | | extended | | |
Not-null constraints:
"test_null_20251210_c1_not_null" NOT NULL "c1"
访问方法 heap

postgres=# alter table test_null_20251210 add constraint xyzxyz not null
c1;
ALTER TABLE
<<<--- above alter table statement should report 'not null constraint
exists',
<<<---- Maybe this problem is a bug ?
postgres=# \d+ test_null_20251210
数据表 "public.test_null_20251210"
栏位 | 类型 | 校对规则 | 可空的 | 预设 | 存储 | 压缩 | 统计目标 | 描述
------+---------+----------+----------+------+----------+------+----------+------
c1 | integer | | not null | | plain | | |
c2 | text | | | | extended | | |
Not-null constraints:
"test_null_20251210_c1_not_null" NOT NULL "c1"
访问方法 heap

postgres=# select version();
version
-----------------------------------------------------------------------------------
PostgreSQL 18.1 on aarch64-unknown-linux-gnu, compiled by gcc (GCC) 7.3.0,
64-bit
(1 行记录)

postgres=#

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Vijay Reddy 2025-12-10 15:50:59 Re: BUG #19339: odbc_fdw extension, Not able to read data from foreign tables
Previous Message ZhangChi 2025-12-10 14:01:22 Re: BUG #19350: Short circuit optimization missed when running sqlscriptes in JDBC