]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix pg_get_constraintdef for NOT NULL constraints on domains
authorÁlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 27 Nov 2024 12:50:27 +0000 (13:50 +0100)
committerÁlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 27 Nov 2024 12:50:27 +0000 (13:50 +0100)
commit6e793582bc663fb7652834170be8902b982b7bcb
tree41327d44619f56cbac02cad07088d26487ecffbc
parent7786717b9e5d0e7ad828a7c7a65c74732ec492a9
Fix pg_get_constraintdef for NOT NULL constraints on domains

We added pg_constraint rows for all not-null constraints, first for
tables and later for domains; but while the ones for tables were
reverted, the ones for domains were not.  However, we did accidentally
revert ruleutils.c support for the ones on domains in 6f8bb7c1e961,
which breaks running pg_get_constraintdef() on them.  Put that back.

This is only needed in branch 17, because we've reinstated this code in
branch master with commit 14e87ffa5c54.  Add some new tests in both
branches.

I couldn't find anything else that needs de-reverting.

Reported-by: Erki Eessaar <erki.eessaar@taltech.ee>
Reviewed-by: Magnus Hagander <magnus@hagander.net>
Discussion: https://postgr.es/m/AS8PR01MB75110350415AAB8BBABBA1ECFE222@AS8PR01MB7511.eurprd01.prod.exchangelabs.com
src/backend/utils/adt/ruleutils.c
src/test/regress/expected/domain.out
src/test/regress/sql/domain.sql