Simplify information schema check constraint deparsing
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 22 Sep 2023 05:40:56 +0000 (07:40 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 22 Sep 2023 05:43:26 +0000 (07:43 +0200)
commite59fcbd712c777eb2987d7c9ad542a7e817954ec
tree3659fbba928f29af54e76ee8041f0473d2bf7282
parent48e2b234f822ea1610826be4526bb56ca4734dbe
Simplify information schema check constraint deparsing

The computation of the column
information_schema.check_constraints.check_clause used
pg_get_constraintdef() plus some string manipulation to get the check
clause back out.  This ended up with an extra pair of parentheses,
which is only an aesthetic problem, but also with suffixes like "NOT
VALID", which don't belong into that column.  We can fix both of these
problems and simplify the code by just using pg_get_expr() instead.

Discussion: https://www.postgresql.org/message-id/799b59ef-3330-f0d2-ee23-8cdfa1740987@eisentraut.org
src/backend/catalog/information_schema.sql
src/include/catalog/catversion.h