diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/btree_gist/btree_gist.sql.in | 31 | ||||
-rw-r--r-- | contrib/cube/cube.sql.in | 4 | ||||
-rw-r--r-- | contrib/intarray/_int.sql.in | 8 | ||||
-rw-r--r-- | contrib/rtree_gist/rtree_gist.sql.in | 12 | ||||
-rw-r--r-- | contrib/seg/seg.sql.in | 4 | ||||
-rw-r--r-- | contrib/tsearch/tsearch.sql.in | 4 |
6 files changed, 42 insertions, 21 deletions
diff --git a/contrib/btree_gist/btree_gist.sql.in b/contrib/btree_gist/btree_gist.sql.in index 7089f1d3b56..98b868afc72 100644 --- a/contrib/btree_gist/btree_gist.sql.in +++ b/contrib/btree_gist/btree_gist.sql.in @@ -41,12 +41,15 @@ create function gint4_union(bytea, opaque) returns int4 as 'MODULE_PATHNAME' lan create function gint4_same(opaque, opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C'; -- add a new opclass -INSERT INTO pg_opclass (opcamid, opcname, opcintype, opckeytype, opcdefault) - SELECT pg_am.oid, 'gist_int4_ops', pg_type.oid, pg_key.oid, true - FROM pg_type, pg_am, pg_type pg_key - WHERE pg_type.typname = 'int4' and - pg_key.typname = 'int4key' and - pg_am.amname='gist'; +INSERT INTO pg_opclass (opcamid, opcname, opcnamespace, opcowner, opcintype, opcdefault, opckeytype) + VALUES ( + (SELECT oid FROM pg_am WHERE amname = 'gist'), + 'gist_int4_ops', + (SELECT oid FROM pg_namespace WHERE nspname = 'pg_catalog'), + 1, -- UID of superuser is hardwired to 1 as of PG 7.3 + (SELECT oid FROM pg_type WHERE typname = 'int4'), + true, + (SELECT oid FROM pg_type WHERE typname = 'int4key')); SELECT o.oid AS opoid, o.oprname @@ -170,12 +173,16 @@ create function gts_union(bytea, opaque) returns int4 as 'MODULE_PATHNAME' langu create function gts_same(opaque, opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C'; -INSERT INTO pg_opclass (opcamid, opcname, opcintype, opckeytype, opcdefault) - SELECT pg_am.oid, 'gist_timestamp_ops', pg_type.oid, pg_key.oid, true - FROM pg_type, pg_am, pg_type pg_key - WHERE pg_type.typname = 'timestamp' and - pg_key.typname = 'tskey' and - pg_am.amname='gist'; +-- add a new opclass +INSERT INTO pg_opclass (opcamid, opcname, opcnamespace, opcowner, opcintype, opcdefault, opckeytype) + VALUES ( + (SELECT oid FROM pg_am WHERE amname = 'gist'), + 'gist_timestamp_ops', + (SELECT oid FROM pg_namespace WHERE nspname = 'pg_catalog'), + 1, -- UID of superuser is hardwired to 1 as of PG 7.3 + (SELECT oid FROM pg_type WHERE typname = 'timestamp'), + true, + (SELECT oid FROM pg_type WHERE typname = 'tskey')); SELECT o.oid AS opoid, o.oprname INTO TABLE timestamp_ops_tmp diff --git a/contrib/cube/cube.sql.in b/contrib/cube/cube.sql.in index 00994d39a00..a1a78ca9f58 100644 --- a/contrib/cube/cube.sql.in +++ b/contrib/cube/cube.sql.in @@ -212,10 +212,12 @@ CREATE FUNCTION g_cube_same(cube, cube, opaque) RETURNS opaque -- register the default opclass for indexing -INSERT INTO pg_opclass (opcamid, opcname, opcintype, opcdefault, opckeytype) +INSERT INTO pg_opclass (opcamid, opcname, opcnamespace, opcowner, opcintype, opcdefault, opckeytype) VALUES ( (SELECT oid FROM pg_am WHERE amname = 'gist'), 'gist_cube_ops', + (SELECT oid FROM pg_namespace WHERE nspname = 'pg_catalog'), + 1, -- UID of superuser is hardwired to 1 as of PG 7.3 (SELECT oid FROM pg_type WHERE typname = 'cube'), true, 0); diff --git a/contrib/intarray/_int.sql.in b/contrib/intarray/_int.sql.in index 61f2cbd3f6f..60a4972984b 100644 --- a/contrib/intarray/_int.sql.in +++ b/contrib/intarray/_int.sql.in @@ -144,10 +144,12 @@ CREATE FUNCTION g_int_same(_int4, _int4, opaque) RETURNS opaque -- register the default opclass for indexing -INSERT INTO pg_opclass (opcamid, opcname, opcintype, opcdefault, opckeytype) +INSERT INTO pg_opclass (opcamid, opcname, opcnamespace, opcowner, opcintype, opcdefault, opckeytype) VALUES ( (SELECT oid FROM pg_am WHERE amname = 'gist'), 'gist__int_ops', + (SELECT oid FROM pg_namespace WHERE nspname = 'pg_catalog'), + 1, -- UID of superuser is hardwired to 1 as of PG 7.3 (SELECT oid FROM pg_type WHERE typname = '_int4'), true, 0); @@ -300,10 +302,12 @@ CREATE FUNCTION g_intbig_same(_int4, _int4, opaque) RETURNS opaque AS 'MODULE_PATHNAME' LANGUAGE 'c'; -- register the opclass for indexing (not as default) -INSERT INTO pg_opclass (opcamid, opcname, opcintype, opcdefault, opckeytype) +INSERT INTO pg_opclass (opcamid, opcname, opcnamespace, opcowner, opcintype, opcdefault, opckeytype) VALUES ( (SELECT oid FROM pg_am WHERE amname = 'gist'), 'gist__intbig_ops', + (SELECT oid FROM pg_namespace WHERE nspname = 'pg_catalog'), + 1, -- UID of superuser is hardwired to 1 as of PG 7.3 (SELECT oid FROM pg_type WHERE typname = '_int4'), false, 0); diff --git a/contrib/rtree_gist/rtree_gist.sql.in b/contrib/rtree_gist/rtree_gist.sql.in index df9bb823f09..0d1770381f4 100644 --- a/contrib/rtree_gist/rtree_gist.sql.in +++ b/contrib/rtree_gist/rtree_gist.sql.in @@ -21,11 +21,13 @@ create function gbox_union(bytea, opaque) returns box as 'MODULE_PATHNAME' langu create function gbox_same(box, box, opaque) returns opaque as 'MODULE_PATHNAME' language 'C'; --- add a new opclass (non-default) -INSERT INTO pg_opclass (opcamid, opcname, opcintype, opcdefault, opckeytype) +-- add a new opclass +INSERT INTO pg_opclass (opcamid, opcname, opcnamespace, opcowner, opcintype, opcdefault, opckeytype) VALUES ( (SELECT oid FROM pg_am WHERE amname = 'gist'), 'gist_box_ops', + (SELECT oid FROM pg_namespace WHERE nspname = 'pg_catalog'), + 1, -- UID of superuser is hardwired to 1 as of PG 7.3 (SELECT oid FROM pg_type WHERE typname = 'box'), true, 0); @@ -183,11 +185,13 @@ create function gpoly_consistent(opaque,polygon,int4) returns bool as 'MODULE_PA create function gpoly_compress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C'; --- add a new opclass (non-default) -INSERT INTO pg_opclass (opcamid, opcname, opcintype, opcdefault, opckeytype) +-- add a new opclass +INSERT INTO pg_opclass (opcamid, opcname, opcnamespace, opcowner, opcintype, opcdefault, opckeytype) VALUES ( (SELECT oid FROM pg_am WHERE amname = 'gist'), 'gist_poly_ops', + (SELECT oid FROM pg_namespace WHERE nspname = 'pg_catalog'), + 1, -- UID of superuser is hardwired to 1 as of PG 7.3 (SELECT oid FROM pg_type WHERE typname = 'polygon'), true, (SELECT oid FROM pg_type WHERE typname = 'box')); diff --git a/contrib/seg/seg.sql.in b/contrib/seg/seg.sql.in index 74739dfc5cf..f8acddeb352 100644 --- a/contrib/seg/seg.sql.in +++ b/contrib/seg/seg.sql.in @@ -236,10 +236,12 @@ CREATE FUNCTION gseg_same(seg, seg, opaque) RETURNS opaque -- register the default opclass for indexing -INSERT INTO pg_opclass (opcamid, opcname, opcintype, opcdefault, opckeytype) +INSERT INTO pg_opclass (opcamid, opcname, opcnamespace, opcowner, opcintype, opcdefault, opckeytype) VALUES ( (SELECT oid FROM pg_am WHERE amname = 'gist'), 'gist_seg_ops', + (SELECT oid FROM pg_namespace WHERE nspname = 'pg_catalog'), + 1, -- UID of superuser is hardwired to 1 as of PG 7.3 (SELECT oid FROM pg_type WHERE typname = 'seg'), true, 0); diff --git a/contrib/tsearch/tsearch.sql.in b/contrib/tsearch/tsearch.sql.in index 48a5ae27e62..e53793cf718 100644 --- a/contrib/tsearch/tsearch.sql.in +++ b/contrib/tsearch/tsearch.sql.in @@ -155,10 +155,12 @@ CREATE FUNCTION gtxtidx_union(bytea, opaque) RETURNS _int4 CREATE FUNCTION gtxtidx_same(gtxtidx, gtxtidx, opaque) RETURNS opaque AS 'MODULE_PATHNAME' LANGUAGE 'c'; -INSERT INTO pg_opclass (opcamid, opcname, opcintype, opcdefault, opckeytype) +INSERT INTO pg_opclass (opcamid, opcname, opcnamespace, opcowner, opcintype, opcdefault, opckeytype) VALUES ( (SELECT oid FROM pg_am WHERE amname = 'gist'), 'gist_txtidx_ops', + (SELECT oid FROM pg_namespace WHERE nspname = 'pg_catalog'), + 1, -- UID of superuser is hardwired to 1 as of PG 7.3 (SELECT oid FROM pg_type WHERE typname = 'txtidx'), true, (SELECT oid FROM pg_type WHERE typname = 'gtxtidx')); |