X-Git-Url: http://www.sigaev.ru/git/gitweb.cgi?a=blobdiff_plain;f=gevel.c;h=4c192128354c54fb35dd13d2a5228a0c1aaea1dd;hb=a28232afd1ec8cf67df1de4d4d8c8f5783762004;hp=675690c9e895999545e5a242c1c3d832c8203594;hpb=1eb8e668b4f1f1e5b95b93df538f6be5364a6d8c;p=gevel.git diff --git a/gevel.c b/gevel.c index 675690c..4c19212 100644 --- a/gevel.c +++ b/gevel.c @@ -68,6 +68,14 @@ gist_index_close(Relation rel) { #endif +#if PG_VERSION_NUM >= 80300 +#define stringToQualifiedNameList(x,y) stringToQualifiedNameList(x) +#endif + +#if PG_VERSION_NUM < 80300 +#define SET_VARSIZE(p,l) VARATT_SIZEP(p)=(l) +#endif + static void gist_dumptree(Relation r, int level, BlockNumber blk, OffsetNumber coff, IdxInfo *info) { Buffer buffer; @@ -130,7 +138,6 @@ gist_tree(PG_FUNCTION_ARGS) { List *relname_list; IdxInfo info; - relname_list = stringToQualifiedNameList(relname, "gist_tree"); relvar = makeRangeVarFromNameList(relname_list); index = gist_index_open(relvar); @@ -146,7 +153,7 @@ gist_tree(PG_FUNCTION_ARGS) { gist_index_close(index); pfree(relname); - VARATT_SIZEP(info.txt)=info.ptr-((char*)info.txt); + SET_VARSIZE(info.txt, info.ptr-((char*)info.txt)); PG_RETURN_POINTER(info.txt); } @@ -256,7 +263,7 @@ gist_stat(PG_FUNCTION_ARGS) { ptr=strchr(ptr,'\0'); - VARATT_SIZEP(out)=ptr-((char*)out); + SET_VARSIZE(out, ptr-((char*)out)); PG_RETURN_POINTER(out); }