pg_catalog.array_upper($1,1),
1) as g(s)';
-CREATE FUNCTION _pg_keyissubset(smallint[], smallint[]) RETURNS boolean
- LANGUAGE sql
- IMMUTABLE
- RETURNS NULL ON NULL INPUT
- AS 'select $1[1] is null or ($1[1] = any ($2) and coalesce(information_schema._pg_keyissubset($1[2:pg_catalog.array_upper($1,1)], $2), true))';
-
CREATE FUNCTION _pg_keysequal(smallint[], smallint[]) RETURNS boolean
- LANGUAGE sql
- IMMUTABLE
- RETURNS NULL ON NULL INPUT
- AS 'select information_schema._pg_keyissubset($1, $2) and information_schema._pg_keyissubset($2, $1)';
+ LANGUAGE sql IMMUTABLE -- intentionally not STRICT, to allow inlining
+ AS 'select $1 <@ $2 and $2 <@ $1';
/* Get the OID of the unique index that an FK constraint depends on */
CREATE FUNCTION _pg_underlying_index(oid) RETURNS oid
OR has_table_privilege(r.oid, 'INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER')
OR has_any_column_privilege(r.oid, 'INSERT, UPDATE, REFERENCES') )
- UNION
+ UNION ALL
-- not-null constraints