Skip to content

Commit 4222491

Browse files
committed
information_schema.constraint_column_usage and key_column_usage should
not discriminate against system columns, since we support constraints on system columns, and in fact constraints on OID are moderately useful.
1 parent 78f637c commit 4222491

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/backend/catalog/information_schema.sql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright 2003, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.20 2003/12/16 14:57:20 petere Exp $
7+
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.21 2003/12/17 22:11:30 tgl Exp $
88
*/
99

1010
/*
@@ -434,7 +434,6 @@ CREATE VIEW constraint_column_usage AS
434434
AND c.connamespace = nc.oid
435435
AND c.contype = 'c'
436436
AND r.relkind = 'r'
437-
AND a.attnum > 0
438437
AND NOT a.attisdropped
439438

440439
UNION ALL
@@ -448,7 +447,6 @@ CREATE VIEW constraint_column_usage AS
448447
AND nc.oid = c.connamespace
449448
AND (CASE WHEN c.contype = 'f' THEN r.oid = c.confrelid AND c.confkey[pos.n] = a.attnum
450449
ELSE r.oid = c.conrelid AND c.conkey[pos.n] = a.attnum END)
451-
AND a.attnum > 0
452450
AND NOT a.attisdropped
453451
AND c.contype IN ('p', 'u', 'f')
454452
AND r.relkind = 'r'
@@ -683,7 +681,6 @@ CREATE VIEW key_column_usage AS
683681
AND r.oid = c.conrelid
684682
AND nc.oid = c.connamespace
685683
AND c.conkey[pos.n] = a.attnum
686-
AND a.attnum > 0
687684
AND NOT a.attisdropped
688685
AND c.contype IN ('p', 'u', 'f')
689686
AND r.relkind = 'r'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy