Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb5e114

Browse files
peterepull[bot]
authored andcommitted
Simplify information schema check constraint deparsing
The computation of the columninformation_schema.check_constraints.check_clause usedpg_get_constraintdef() plus some string manipulation to get the checkclause back out. This ended up with an extra pair of parentheses,which is only an aesthetic problem, but also with suffixes like "NOTVALID", which don't belong into that column. We can fix both of theseproblems 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
1 parent2d1e7da commitfb5e114

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

‎src/backend/catalog/information_schema.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,7 @@ CREATE VIEW check_constraints AS
435435
SELECT CAST(current_database()AS sql_identifier)AS constraint_catalog,
436436
CAST(rs.nspnameAS sql_identifier)AS constraint_schema,
437437
CAST(con.connameAS sql_identifier)AS constraint_name,
438-
CAST(substring(pg_get_constraintdef(con.oid)from7)AS character_data)
439-
AS check_clause
438+
CAST(pg_get_expr(con.conbin, coalesce(c.oid,0))AS character_data)AS check_clause
440439
FROM pg_constraint con
441440
LEFT OUTER JOIN pg_namespace rsON (rs.oid=con.connamespace)
442441
LEFT OUTER JOIN pg_class cON (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-
#defineCATALOG_VERSION_NO202309181
60+
#defineCATALOG_VERSION_NO202309221
6161

6262
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp