| From: | jian he <jian(dot)universality(at)gmail(dot)com> |
|---|---|
| To: | Quan Zongliang <quanzongliang(at)yeah(dot)net> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: ALTER DOMAIN ADD NOT NULL NOT VALID |
| Date: | 2025-05-28 07:38:51 |
| Message-ID: | CACJufxGBHDu8yOC-Gd7QpptBaB-AnRWWqeyZkBu9WLqvh3vrKQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, May 22, 2025 at 10:08 PM Quan Zongliang <quanzongliang(at)yeah(dot)net> wrote:
>
> It makes sense to support the "NOT NULL NOT VALID" option.
>
> The two if statements in the AlterDomainNotNull() should be adjusted.
>
> if (typTup->typnotnull == notNull && !notNull)
> ==>
> if (!notNull && !typTup->typnotnull)
>
>
> if (typTup->typnotnull == notNull && notNull)
> ==>
> if (notNull && typTup->typnotnull)
>
yech, you are right.
There is one failed test [0] because of query result order,
so I add "ORDER BY conname COLLATE "C";" to stabilize tests.
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0001-ALTER-DOMAIN-ADD-NOT-NULL-NOT-VALID.patch | text/x-patch | 17.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Antonin Houska | 2025-05-28 07:51:15 | Foreign key validation failure in 18beta1 |
| Previous Message | jian he | 2025-05-28 06:55:16 | Re: finish TODOs in to_json_is_immutable, to_jsonb_is_immutable also add tests on it |