Fix same schema to treat pg_constraint.confmatchtype = 'u' = 's'
authorglynastill <[email protected]>
Thu, 13 Aug 2015 16:23:43 +0000 (17:23 +0100)
committerglyn <[email protected]>
Tue, 7 Jun 2016 11:13:40 +0000 (12:13 +0100)
This relates to a change in the character representing a simple match
on a foreign key stored in the confmatchtype field changing from 'u'
to 's' between postgresql 9.2 and 9.3. Ref:

http://www.postgresql.org/docs/9.2/static/catalog-pg-constraint.html
http://www.postgresql.org/docs/9.3/static/catalog-pg-constraint.html

check_postgres.pl

index c726d10a5959b8e2f6a68ea01aeb79622c89ff99..e29501558406d4607fd72069a9b026eeac3e1470 100755 (executable)
@@ -1119,7 +1119,7 @@ JOIN pg_namespace n ON (n.oid = p.pronamespace)},
         SQL       => q{
 SELECT c.*, c.oid, n.nspname||'.'||c1.relname||'.'||c.conname AS name, quote_ident(c.conname) AS safename,
  n.nspname AS schema, r.relname AS tname,
- pg_get_constraintdef(c.oid) AS constraintdef
+ pg_get_constraintdef(c.oid) AS constraintdef, translate(c.confmatchtype,'u','s') AS confmatchtype_compat
 FROM pg_constraint c
 JOIN pg_class c1 ON (c1.oid = c.conrelid)
 JOIN pg_namespace n ON (n.oid = c.connamespace)
@@ -6756,7 +6756,8 @@ sub check_same_schema {
                         indexprs,indcheckxmin,reltablespace,
                         indkey',                                  ''          ],
         [trigger    => 'tgqual,tgconstraint',                     ''          ],
-        [constraint => 'conbin,conindid,conkey,confkey',          ''          ],
+        [constraint => 'conbin,conindid,conkey,confkey
+                        confmatchtype',                           ''          ],
         [column     => 'atttypid,attnum,attbyval,attndims',       ''          ],
     );