pjungwir / range_agg Goto Github PK
View Code? Open in Web Editor NEWPostgres extension to merge adjacent/overlapping ranges
License: MIT License
Postgres extension to merge adjacent/overlapping ranges
License: MIT License
On pgxn install range_agg
, I get the following error:
#37 0.737 INFO: best version: range_agg 1.2.1
#37 0.967 INFO: saving /tmp/tmpaq0o71ft/range_agg-1.2.1.zip
#37 0.972 INFO: unpacking: /tmp/tmpaq0o71ft/range_agg-1.2.1.zip
#37 0.977 INFO: building extension
#37 1.003 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -c -o range_agg.o range_agg.c
#37 1.060 In file included from range_agg.c:22:
#37 1.060 util.c:6:1: error: static declaration of ‘range_union_internal’ follows non-static declaration
#37 1.060 6 | range_union_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2,
#37 1.060 | ^~~~~~~~~~~~~~~~~~~~
#37 1.060 In file included from range_agg.c:8:
#37 1.060 /usr/include/postgresql/14/server/utils/rangetypes.h:120:19: note: previous declaration of ‘range_union_internal’ was here
#37 1.060 120 | extern RangeType *range_union_internal(TypeCacheEntry *typcache, RangeType *r1,
#37 1.060 | ^~~~~~~~~~~~~~~~~~~~
#37 1.073 gmake: *** [<builtin>: range_agg.o] Error 1
#37 1.073 ERROR: command returned 2: gmake PG_CONFIG=/usr/bin/pg_config all
When I search for error: static declaration of follows non-static declaration
, I find: https://stackoverflow.com/questions/3148244/how-to-solve-static-declaration-follows-non-static-declaration-in-gcc-c-code/3148354#3148354
I'm not C-literate, so not really able to compile a PR with a suggested fix.
Can you help?
Hi,
I am having problems using this extension in Postgres 12. Compilation seems to be successful (although some warnings are emitted, see below). However, enabling the extension with CREATE EXTENSION IF NOT EXISTS range_agg;
fails with
ERROR: could not load library "/usr/lib/postgresql/12/lib/range_agg.so": /usr/lib/postgresql/12/lib/range_agg.so: undefined symbol: RangeTypeGetDatum
I am compiling the extension in the official postgres docker image.
Compilation produces these warnings
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c -o range_agg.o range_agg.c
range_agg.c: In function ‘range_agg_finalfn’:
range_agg.c:107:15: warning: implicit declaration of function ‘DatumGetRangeType’; did you mean ‘DatumGetRangeTypeP’? [-Wimplicit-function-declaration]
lastRange = DatumGetRangeType(inputVals[0]);
^~~~~~~~~~~~~~~~~
DatumGetRangeTypeP
range_agg.c:107:13: warning: assignment to ‘RangeType *’ {aka ‘struct <anonymous> *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
lastRange = DatumGetRangeType(inputVals[0]);
^
range_agg.c:110:18: warning: assignment to ‘RangeType *’ {aka ‘struct <anonymous> *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
currentRange = DatumGetRangeType(inputVals[i]);
^
range_agg.c:127:39: warning: implicit declaration of function ‘RangeTypeGetDatum’; did you mean ‘RangeTypePGetDatum’? [-Wimplicit-function-declaration]
accumArrayResult(resultContent, RangeTypeGetDatum(lastRange), false, rangeTypeId, aggContext);
^~~~~~~~~~~~~~~~~
RangeTypePGetDatum
range_agg.c:80:9: warning: variable ‘inputNulls’ set but not used [-Wunused-but-set-variable]
bool *inputNulls;
^~~~~~~~~~
range_agg.c: In function ‘element_compare’:
range_agg.c:155:19: warning: initialization of ‘RangeType *’ {aka ‘struct <anonymous> *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
RangeType *r1 = DatumGetRangeType(*d1);
^~~~~~~~~~~~~~~~~
range_agg.c:156:19: warning: initialization of ‘RangeType *’ {aka ‘struct <anonymous> *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
RangeType *r2 = DatumGetRangeType(*d2);
^~~~~~~~~~~~~~~~~
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC range_agg.o -L/usr/lib/x86_64-linux-gnu -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-7/lib -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed -shared -o range_agg.so
/usr/bin/clang-7 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2 -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5 -flto=thin -emit-llvm -c -o range_agg.bc range_agg.c
range_agg.c:107:15: warning: implicit declaration of function 'DatumGetRangeType' is invalid in C99 [-Wimplicit-function-declaration]
lastRange = DatumGetRangeType(inputVals[0]);
^
range_agg.c:107:13: warning: incompatible integer to pointer conversion assigning to 'RangeType *' from 'int' [-Wint-conversion]
lastRange = DatumGetRangeType(inputVals[0]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
range_agg.c:110:18: warning: incompatible integer to pointer conversion assigning to 'RangeType *' from 'int' [-Wint-conversion]
currentRange = DatumGetRangeType(inputVals[i]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
range_agg.c:127:39: warning: implicit declaration of function 'RangeTypeGetDatum' is invalid in C99 [-Wimplicit-function-declaration]
accumArrayResult(resultContent, RangeTypeGetDatum(lastRange), false, rangeTypeId, aggContext);
^
range_agg.c:142:35: warning: implicit declaration of function 'RangeTypeGetDatum' is invalid in C99 [-Wimplicit-function-declaration]
accumArrayResult(resultContent, RangeTypeGetDatum(lastRange), false, rangeTypeId, aggContext);
^
range_agg.c:155:19: warning: implicit declaration of function 'DatumGetRangeType' is invalid in C99 [-Wimplicit-function-declaration]
RangeType *r1 = DatumGetRangeType(*d1);
^
range_agg.c:155:14: warning: incompatible integer to pointer conversion initializing 'RangeType *' with an expression of type 'int' [-Wint-conversion]
RangeType *r1 = DatumGetRangeType(*d1);
^ ~~~~~~~~~~~~~~~~~~~~~~
range_agg.c:156:14: warning: incompatible integer to pointer conversion initializing 'RangeType *' with an expression of type 'int' [-Wint-conversion]
RangeType *r2 = DatumGetRangeType(*d2);
^ ~~~~~~~~~~~~~~~~~~~~~~
8 warnings generated.
Any chance you could look at it?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.