From: teodor Date: Tue, 27 Dec 2011 16:21:37 +0000 (+0000) Subject: fix 9.1 support X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=bbcb5eef2dde554cb27b74f1ceff8391cfe85f4f;p=gevel.git fix 9.1 support --- diff --git a/expected/gevel.out.9.1 b/expected/gevel.out.9.1 index a80f77f..3f3e28d 100644 --- a/expected/gevel.out.9.1 +++ b/expected/gevel.out.9.1 @@ -3,7 +3,12 @@ SET client_min_messages = warning; RESET client_min_messages; CREATE TABLE gevelt ( t box ); \copy gevelt from 'data/rect.data' +SELECT center(t) AS p INTO gevelp FROM gevelt; CREATE INDEX gist_idx ON gevelt USING gist ( t ); +CREATE INDEX spgist_idx ON gevelp USING spgist ( p ); +ERROR: access method "spgist" does not exist +CREATE INDEX kdspgist_idx ON gevelp USING spgist ( p kd_point_ops); +ERROR: access method "spgist" does not exist --GiST SELECT gist_stat('gist_idx'); gist_stat @@ -96,6 +101,21 @@ SELECT * FROM gist_print('gist_idx') as t(level int, valid bool, a box) where le 1 | t | (31179,37276),(24921,25000) (32 rows) +--SPGiST +SELECT spgist_stat('spgist_idx'); +NOTICE: Function is not working under PgSQL < 9.2 + spgist_stat +------------- + ??? +(1 row) + +SELECT * FROM spgist_print('kdspgist_idx') as t(tid tid, node_n int, level int, tid_pointer tid, prefix float8, node_label int, leaf_value point); +NOTICE: Function is not working under PgSQL < 9.2 +ERROR: cache lookup failed for type 2779096485 +SELECT * FROM spgist_print('spgist_idx') as t(tid tid, node_n int, level int, tid_pointer tid, prefix point, node_label int, leaf_value point) WHERE level = 1; +NOTICE: Function is not working under PgSQL < 9.2 +ERROR: cache lookup failed for type 2779096485 +--GIN CREATE TABLE test__int( a int[] ); \copy test__int from 'data/test__int.data' CREATE INDEX gin_idx ON test__int USING gin ( a ); diff --git a/gevel.c b/gevel.c index d13c724..ed7895b 100644 --- a/gevel.c +++ b/gevel.c @@ -63,7 +63,7 @@ PG_MODULE_MAGIC; static Relation gist_index_open(RangeVar *relvar) { -#if PG_VERSION_NUM <= 90100 +#if PG_VERSION_NUM < 90200 Oid relOid = RangeVarGetRelid(relvar, false); #else Oid relOid = RangeVarGetRelid(relvar, NoLock, false); @@ -76,7 +76,7 @@ gist_index_open(RangeVar *relvar) { static Relation gin_index_open(RangeVar *relvar) { -#if PG_VERSION_NUM <= 90100 +#if PG_VERSION_NUM < 90200 Oid relOid = RangeVarGetRelid(relvar, false); #else Oid relOid = RangeVarGetRelid(relvar, NoLock, false);