summaryrefslogtreecommitdiff
path: root/contrib/seg
diff options
context:
space:
mode:
authorTom Lane2016-11-29 20:05:22 +0000
committerTom Lane2016-11-29 20:05:22 +0000
commitade49c605f1d8f517497829363f8b83f69c73a60 (patch)
tree95ac16d5feb33f0fc017c2973e5afee303cdfd95 /contrib/seg
parent11da83a0e70d32ed0e06a5c948cd8343f8ad5102 (diff)
Test all contrib-created operator classes with amvalidate.
I'd supposed that people would do this manually when creating new operator classes, but the folly of that was exposed today. The tests seem fast enough that we can just apply them during the normal regression tests. contrib/isn fails the checks for lack of complete sets of cross-type operators. That's a nice-to-have policy rather than a functional requirement, so leave it as-is, but insert ORDER BY in the query to ensure consistent cross-platform output. Discussion: https://postgr.es/m/7076.1480446837@sss.pgh.pa.us
Diffstat (limited to 'contrib/seg')
-rw-r--r--contrib/seg/expected/seg.out8
-rw-r--r--contrib/seg/expected/seg_1.out8
-rw-r--r--contrib/seg/sql/seg.sql5
3 files changed, 21 insertions, 0 deletions
diff --git a/contrib/seg/expected/seg.out b/contrib/seg/expected/seg.out
index 1f82a4abb86..18010c4d5cf 100644
--- a/contrib/seg/expected/seg.out
+++ b/contrib/seg/expected/seg.out
@@ -2,6 +2,14 @@
-- Test seg datatype
--
CREATE EXTENSION seg;
+-- Check whether any of our opclasses fail amvalidate
+SELECT amname, opcname
+FROM pg_opclass opc LEFT JOIN pg_am am ON am.oid = opcmethod
+WHERE opc.oid >= 16384 AND NOT amvalidate(opc.oid);
+ amname | opcname
+--------+---------
+(0 rows)
+
--
-- testing the input and output functions
--
diff --git a/contrib/seg/expected/seg_1.out b/contrib/seg/expected/seg_1.out
index 563c744b2d6..566ce394ed0 100644
--- a/contrib/seg/expected/seg_1.out
+++ b/contrib/seg/expected/seg_1.out
@@ -2,6 +2,14 @@
-- Test seg datatype
--
CREATE EXTENSION seg;
+-- Check whether any of our opclasses fail amvalidate
+SELECT amname, opcname
+FROM pg_opclass opc LEFT JOIN pg_am am ON am.oid = opcmethod
+WHERE opc.oid >= 16384 AND NOT amvalidate(opc.oid);
+ amname | opcname
+--------+---------
+(0 rows)
+
--
-- testing the input and output functions
--
diff --git a/contrib/seg/sql/seg.sql b/contrib/seg/sql/seg.sql
index 7b7f138dbf6..aa919314740 100644
--- a/contrib/seg/sql/seg.sql
+++ b/contrib/seg/sql/seg.sql
@@ -4,6 +4,11 @@
CREATE EXTENSION seg;
+-- Check whether any of our opclasses fail amvalidate
+SELECT amname, opcname
+FROM pg_opclass opc LEFT JOIN pg_am am ON am.oid = opcmethod
+WHERE opc.oid >= 16384 AND NOT amvalidate(opc.oid);
+
--
-- testing the input and output functions
--