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

Commit6959cb5

Browse files
committed
Fix incorrect permissions check in information_schema.key_column_usage view:
it was checking a pg_constraint OID instead of pg_class OID, resulting in"relation with OID nnnnn does not exist" failures for anyone who wasn'towner of the table being examined. Per bug #2848 from Laurence Rowe.Note: for existing 8.2 installations a simple version update won't fix this;the easiest fix is to CREATE OR REPLACE this view with the correcteddefinition.
1 parent10a5e33 commit6959cb5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/backend/catalog/information_schema.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2003-2007, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.39 2007/01/05 22:19:24 momjian Exp $
7+
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.40 2007/01/16 18:32:26 tgl Exp $
88
*/
99

1010
/*
@@ -964,10 +964,10 @@ CREATE VIEW key_column_usage AS
964964
ANDr.relkind='r'
965965
AND (NOT pg_is_other_temp_schema(nr.oid))
966966
AND (pg_has_role(r.relowner,'USAGE')
967-
OR has_table_privilege(c.oid,'SELECT')
968-
OR has_table_privilege(c.oid,'INSERT')
969-
OR has_table_privilege(c.oid,'UPDATE')
970-
OR has_table_privilege(c.oid,'REFERENCES')) )AS ss
967+
OR has_table_privilege(r.oid,'SELECT')
968+
OR has_table_privilege(r.oid,'INSERT')
969+
OR has_table_privilege(r.oid,'UPDATE')
970+
OR has_table_privilege(r.oid,'REFERENCES')) )AS ss
971971
WHEREss.roid=a.attrelid
972972
ANDa.attnum= (ss.x).x
973973
AND NOTa.attisdropped;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp