Skip to content

Commit a0a5e0f

Browse files
committed
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
1 parent 9d17e5f commit a0a5e0f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/catalog/information_schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ CREATE VIEW check_constraints AS
449449
SELECT current_database()::information_schema.sql_identifier AS constraint_catalog,
450450
rs.nspname::information_schema.sql_identifier AS constraint_schema,
451451
con.conname::information_schema.sql_identifier AS constraint_name,
452-
pg_catalog.format('CHECK (%s IS NOT NULL)', at.attname)::information_schema.character_data AS check_clause
452+
pg_catalog.format('%s IS NOT NULL', at.attname)::information_schema.character_data AS check_clause
453453
FROM pg_constraint con
454454
LEFT JOIN pg_namespace rs ON rs.oid = con.connamespace
455455
LEFT JOIN pg_class c ON c.oid = con.conrelid

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
*/
5858

5959
/* yyyymmddN */
60-
#define CATALOG_VERSION_NO 202309061
60+
#define CATALOG_VERSION_NO 202309181
6161

6262
#endif

0 commit comments

Comments
 (0)