postgres.git / summary / log / commit / refs
commit a0a5e0feb35c1209e340046dc4e40af3b0e79d59
Author: Peter Eisentraut <peter@eisentraut.org>
Date: Mon Sep 18 06:10:51 2023 +0000
First released in: 17.0
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 8fc0fb4bcdb..7f7de91cc24 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 4eaef54d0ca..8799f3f03a4 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
[parent: 9d17e5f16fbe]