From: | Tender Wang <tndrwang(at)gmail(dot)com> |
---|---|
To: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
Cc: | jian he <jian(dot)universality(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Can't find not null constraint, but \d+ shows that |
Date: | 2024-03-28 12:05:04 |
Message-ID: | CAHewXNn_So7LUCxxxyDNfdvCQp1TnD3gTVECBZX2bT_nbPgraQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> 于2024年3月28日周四 17:18写道:
> On 2024-Mar-28, Tender Wang wrote:
>
> > RemoveConstraintById() should think recurse(e.g. partition table)? I'm
> not
> > sure now.
> > If we should think process recurse in RemoveConstraintById(), the
> > function will look complicated than before.
>
> No -- this function handles just a single constraint, as identified by
> OID. The recursion is handled by upper layers, which can be either
> dependency.c or tablecmds.c. I think the problem you found is caused by
> the fact that I worked with the tablecmds.c recursion and neglected the
> one in dependency.c.
>
Indeed.
create table skip_wal_skip_rewrite_index (c varchar(10) primary key);
alter table skip_wal_skip_rewrite_index alter c type varchar(20);
Above SQL need attnotnull to be true when re-add index, but
RemoveConstraintById() is hard to recognize this scenario as I know.
We should re-set attnotnull to be true before re-add index. I add a new
AT_PASS in attached patch.
Any thoughts?
--
Tender Wang
OpenPie: https://en.openpie.com/
Attachment | Content-Type | Size |
---|---|---|
v4-0001-Fix-pg_attribute-attnotnull-not-reset-when-droppe.patch | application/octet-stream | 8.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Andrey M. Borodin | 2024-03-28 12:09:30 | Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns |
Previous Message | Amit Kapila | 2024-03-28 12:03:15 | Re: Support logical replication of DDLs |