From a0a5e0feb35c1209e340046dc4e40af3b0e79d59 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 18 Sep 2023 08:10:51 +0200 Subject: [PATCH] Fix information schema for catalogued not-null constraints The column check_constraints.check_clause should be like col IS NOT NULL without a surrounding CHECK (...). Discussion: https://www.postgresql.org/message-id/09489196-0bc1-e796-c43e-63425f7c5910@eisentraut.org --- src/backend/catalog/information_schema.sql | 2 +- src/include/catalog/catversion.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql index 8fc0fb4bcd..7f7de91cc2 100644 --- a/src/backend/catalog/information_schema.sql +++ b/src/backend/catalog/information_schema.sql @@ -449,7 +449,7 @@ CREATE VIEW check_constraints AS SELECT current_database()::information_schema.sql_identifier AS constraint_catalog, rs.nspname::information_schema.sql_identifier AS constraint_schema, con.conname::information_schema.sql_identifier AS constraint_name, - pg_catalog.format('CHECK (%s IS NOT NULL)', at.attname)::information_schema.character_data AS check_clause + pg_catalog.format('%s IS NOT NULL', at.attname)::information_schema.character_data AS check_clause FROM pg_constraint con LEFT JOIN pg_namespace rs ON rs.oid = con.connamespace LEFT JOIN pg_class c ON c.oid = con.conrelid diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 4eaef54d0c..8799f3f03a 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -57,6 +57,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202309061 +#define CATALOG_VERSION_NO 202309181 #endif