From a94e4c045decb2a5130273cbdb18c10cd6301589 Mon Sep 17 00:00:00 2001 From: Vincent Picavet Date: Thu, 30 Jul 2015 16:45:51 +0200 Subject: [PATCH] Fix PG 9.5 compatibility. --- NEWS | 1 + pgsql/pc_access.c | 10 +--------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index f4dcdb3..4697dac 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ - Enhancements - Support sigbits encoding for 64bit integers (#61) - Warn about truncated values (#68) + - Compatibility with PostgreSQL 9.5 (#90) 1.0.0 ----- diff --git a/pgsql/pc_access.c b/pgsql/pc_access.c index b9ea76e..1ac26b8 100644 --- a/pgsql/pc_access.c +++ b/pgsql/pc_access.c @@ -353,15 +353,7 @@ Datum pointcloud_agg_transfn(PG_FUNCTION_ARGS) (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("could not determine input data type"))); - if (fcinfo->context && IsA(fcinfo->context, AggState)) - { - aggcontext = ((AggState *) fcinfo->context)->aggcontext; - } - else if (fcinfo->context && IsA(fcinfo->context, WindowAggState)) - { - aggcontext = ((WindowAggState *) fcinfo->context)->aggcontext; - } - else + if ( ! AggCheckCallContext(fcinfo, &aggcontext) ) { /* cannot be called directly because of dummy-type argument */ elog(ERROR, "pointcloud_agg_transfn called in non-aggregate context");