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

Commitd84ffff

Browse files
committed
Add DISTINCT to information schema usage views
Since pg_depend can contain duplicate entries, we need to eliminatethose in information schema views that build on pg_depend, usingDISTINCT. Some of the older views already did that correctly, butsome of the more recently added ones didn't. (In some of these views,it might not be possible to reproduce the issue because of how theimplementation happens to deduplicate dependencies while recordingthem, but it seems better to keep this consistent in all cases.)
1 parent39d0928 commitd84ffff

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

‎src/backend/catalog/information_schema.sql

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ GRANT SELECT ON character_sets TO PUBLIC;
406406
*/
407407

408408
CREATEVIEWcheck_constraint_routine_usageAS
409-
SELECT CAST(current_database()AS sql_identifier)AS constraint_catalog,
409+
SELECT DISTINCT
410+
CAST(current_database()AS sql_identifier)AS constraint_catalog,
410411
CAST(nc.nspnameAS sql_identifier)AS constraint_schema,
411412
CAST(c.connameAS sql_identifier)AS constraint_name,
412413
CAST(current_database()AS sql_identifier)AS specific_catalog,
@@ -505,7 +506,8 @@ GRANT SELECT ON collation_character_set_applicability TO PUBLIC;
505506
*/
506507

507508
CREATEVIEWcolumn_column_usageAS
508-
SELECT CAST(current_database()AS sql_identifier)AS table_catalog,
509+
SELECT DISTINCT
510+
CAST(current_database()AS sql_identifier)AS table_catalog,
509511
CAST(n.nspnameAS sql_identifier)AS table_schema,
510512
CAST(c.relnameAS sql_identifier)AS table_name,
511513
CAST(ac.attnameAS sql_identifier)AS column_name,
@@ -1325,7 +1327,8 @@ GRANT SELECT ON role_column_grants TO PUBLIC;
13251327
*/
13261328

13271329
CREATEVIEWroutine_column_usageAS
1328-
SELECT CAST(current_database()AS sql_identifier)AS specific_catalog,
1330+
SELECT DISTINCT
1331+
CAST(current_database()AS sql_identifier)AS specific_catalog,
13291332
CAST(np.nspnameAS sql_identifier)AS specific_schema,
13301333
CAST(nameconcatoid(p.proname,p.oid)AS sql_identifier)AS specific_name,
13311334
CAST(current_database()AS sql_identifier)AS routine_catalog,
@@ -1434,7 +1437,8 @@ GRANT SELECT ON role_routine_grants TO PUBLIC;
14341437
*/
14351438

14361439
CREATEVIEWroutine_routine_usageAS
1437-
SELECT CAST(current_database()AS sql_identifier)AS specific_catalog,
1440+
SELECT DISTINCT
1441+
CAST(current_database()AS sql_identifier)AS specific_catalog,
14381442
CAST(np.nspnameAS sql_identifier)AS specific_schema,
14391443
CAST(nameconcatoid(p.proname,p.oid)AS sql_identifier)AS specific_name,
14401444
CAST(current_database()AS sql_identifier)AS routine_catalog,
@@ -1462,7 +1466,8 @@ GRANT SELECT ON routine_routine_usage TO PUBLIC;
14621466
*/
14631467

14641468
CREATEVIEWroutine_sequence_usageAS
1465-
SELECT CAST(current_database()AS sql_identifier)AS specific_catalog,
1469+
SELECT DISTINCT
1470+
CAST(current_database()AS sql_identifier)AS specific_catalog,
14661471
CAST(np.nspnameAS sql_identifier)AS specific_schema,
14671472
CAST(nameconcatoid(p.proname,p.oid)AS sql_identifier)AS specific_name,
14681473
CAST(current_database()AS sql_identifier)AS routine_catalog,
@@ -1493,7 +1498,8 @@ GRANT SELECT ON routine_sequence_usage TO PUBLIC;
14931498
*/
14941499

14951500
CREATEVIEWroutine_table_usageAS
1496-
SELECT CAST(current_database()AS sql_identifier)AS specific_catalog,
1501+
SELECT DISTINCT
1502+
CAST(current_database()AS sql_identifier)AS specific_catalog,
14971503
CAST(np.nspnameAS sql_identifier)AS specific_schema,
14981504
CAST(nameconcatoid(p.proname,p.oid)AS sql_identifier)AS specific_name,
14991505
CAST(current_database()AS sql_identifier)AS routine_catalog,

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO202104201
56+
#defineCATALOG_VERSION_NO202104211
5757

5858
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp