X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=smlar.git;a=blobdiff_plain;f=smlar.c;h=672e453b480832c42cb5018801ca3b711f3f3712;hp=13c8169ba49a2b6a7e6432146baea0e639095100;hb=8a465bb03ae7e2e85c3f9e1ebd75eb4ec830f3c5;hpb=92dc9c753b98700a2533d160c243b6ee24606943 diff --git a/smlar.c b/smlar.c index 13c8169..672e453 100644 --- a/smlar.c +++ b/smlar.c @@ -16,7 +16,9 @@ #include "utils/fmgroids.h" #include "utils/lsyscache.h" #include "utils/memutils.h" +#if (PG_VERSION_NUM < 120000) #include "utils/tqual.h" +#endif #include "utils/syscache.h" #include "utils/typcache.h" @@ -28,6 +30,11 @@ PG_MODULE_MAGIC; #define SNAPSHOT SnapshotNow #endif +#if PG_VERSION_NUM >= 130000 +#define heap_open(r, l) table_open((r), (l)) +#define heap_close(r, l) table_close((r), (l)) +#endif + static Oid getDefaultOpclass(Oid amoid, Oid typid) { @@ -56,7 +63,11 @@ getDefaultOpclass(Oid amoid, Oid typid) { if ( OidIsValid(opclassOid) ) elog(ERROR, "Ambiguous opclass for type %u (access method %u)", typid, amoid); +#if (PG_VERSION_NUM >= 120000) + opclassOid = opclass->oid; +#else opclassOid = HeapTupleGetOid(tuple); +#endif } }