postgrespro / jsquery Goto Github PK
View Code? Open in Web Editor NEWJsQuery – json query language with GIN indexing support
License: Other
JsQuery – json query language with GIN indexing support
License: Other
PostgreSQL Database Management System ===================================== This directory contains the source code distribution of the PostgreSQL database management system. PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings. PostgreSQL has many language interfaces, many of which are listed here: http://www.postgresql.org/download See the file INSTALL for instructions on how to build and install PostgreSQL. That file also lists supported operating systems and hardware platforms and contains information regarding any other software packages that are required to build or run the PostgreSQL system. Copyright and license information can be found in the file COPYRIGHT. A comprehensive documentation set is included in this distribution; it can be read as described in the installation instructions. The latest version of this software may be obtained at http://www.postgresql.org/download/. For more information look at our web site located at http://www.postgresql.org/.
Hi,
how I can escape double quotes in values ?
select * from statements_json t where t.data @@ '"u:ba#title".* ($ = "something "" '' ")' and t.version is null;
select * from statements_json t where t.data @@ '"u:ba#title".* ($ = "something \" '' ")' and t.version is null;
For both cases I get:
ERROR: bad jsquery representation Detail: syntax error, unexpected STRING_P, expecting OR_P or AND_P or ')' at or near " "
Any tip how I should escape double quotes in values ? Escaping single quotes is OK, but double quotes are not.
is it possible to select the value for the key in json using JSQuery?
Something like this:
SELECT value @@ (.color) FROM js_test WHERE value @@ '.color = *'
Basically I am interested to see the value of color key in all the json documents if available. My key could be present in any level inside the json.
Thanks.
Currently getting this error when building against 9.5devel as CRC has been changed:
jsquery_op.c:19:26: fatal error: utils/pg_crc.h: No such file or directory
#include "utils/pg_crc.h"
^
Could this be updated to support 9.5?
during installation an error occurs
server:/tmp/jsquery# make USE_PGXS=1
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -fpic -I. -I./ -I/usr/include/postgresql/9.4/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.5 -c -o jsquery_gram.o jsquery_gram.c
jsquery_gram.y:50:26: fatal error: jsquery_gram.h: Нет такого файла или каталога
compilation terminated.
make: *** [jsquery_gram.o] Ошибка 1
Hello,
big thx for jsquery!
We need some additional expressions for strings:
"path" LIKE "val%"
"path" ILIKE "%VAL%"
I need help in building JsQuery extension for Windows to use with PostgreSQL 9.4 for Windows.
Hi! Is it bug? Or what i do wrong?
=> explain analyze select * from mytable where ( data @@ 'NOT attr = *');
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------
Seq Scan on mytable (cost=0.00..101937.27 rows=506315 width=254) (actual time=0.080..920.274 rows=483749 loops=1)
Filter: (data @@ '(NOT "attr" = *)'::jsquery)
Rows Removed by Filter: 23073
Planning time: 2.892 ms
Execution time: 966.762 ms
=> explain analyze select * from mytable where ( data @@ 'attr = *');
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------
Bitmap Heap Scan on mytable (cost=31.93..1951.83 rows=507 width=254) (actual time=41.431..135.250 rows=23073 loops=1)
Recheck Cond: (data @@ '"attr" = *'::jsquery)
Heap Blocks: exact=13967
-> Bitmap Index Scan on mytable_data_idx1 (cost=0.00..31.80 rows=507 width=0) (actual time=38.447..38.447 rows=23073 loops=
Index Cond: (data @@ '"attr" = *'::jsquery)
Planning time: 2.073 ms
Execution time: 138.120 ms
(7 rows)
With bison 3.7, some error message changed and makes the jsquery regression tests fail:
607--- /tmp/autopkgtest-lxc.qv5k86ce/downtmp/build.QH8/src/expected/jsquery.out 2020-07-27 04:40:49.000000000 +0000
608+++ /tmp/autopkgtest-lxc.qv5k86ce/downtmp/build.QH8/src/results/jsquery.out 2020-07-27 04:41:38.828913000 +0000
609@@ -67,7 +67,7 @@
610 ERROR: bad jsquery representation
611 LINE 1: select '* < 13 AND #.zxc"x" = "true"'::jsquery;
612 ^
613-DETAIL: syntax error, unexpected STRING_P, expecting $end at or near """
614+DETAIL: syntax error, unexpected STRING_P, expecting end of file at or near """
615 select 'a < 1'::jsquery;
616 jsquery
617 ---------
618@@ -1183,7 +1183,7 @@
619 ERROR: bad jsquery representation
620 LINE 1: select 'a\r = x"\\abcd"'::jsquery AS err;
621 ^
622-DETAIL: syntax error, unexpected STRING_P, expecting $end at or near """
623+DETAIL: syntax error, unexpected STRING_P, expecting end of file at or near """
624 --IS
625 select 'as IS boolean OR as is ARRAY OR as is ObJect OR as is Numeric OR as is string'::jsquery;
Full test log: https://salsa.debian.org/postgresql/jsquery/-/jobs/891573
For the future system development, we are trying to use Postgres9.4.1 and jsquery,
JSONB and jsquery is indispensable for the general purpose of the data model.
We are grateful to your provision of function!
I have a question.
When using the "IN" as follows,
error occurs when the number of elements exceeds 16.
SELECT info FROM sampleTable WHERE info @@ 'orderDate IN ("2015/06/01", "2015/06/02", ... , "2015/06/17")';
Is it possible to increase the maximum number of elements?
For example 100.
Hideki Egami
Hello,
While experimenting with jsquery, I encountered the following problem:
contrib_regression=# select 'NOT similar_product_ids.#: (NOT $ = "0440180295")'::jsquery::text::jsquery;
ERROR: bad jsquery representation
DETAIL: syntax error, unexpected NOT_P at or near " "
So, jsquery_in() fails to parse back the output generated by jsquery_out().
The problem seems to be with the jsquery_out(), which fails to add parenthesis around the expression:
contrib_regression=# select 'NOT similar_product_ids.#: (NOT $ = "0440180295")'::jsquery::text;
NOT ("similar_product_ids".#:NOT ($ = "0440180295"))
(1 row)
AFAICS jsquery_in() expects a parenthesis around the inner expression starting with 'NOT'. FWIW the attached patch fixes the problem for me, but I'm not sure if we should fix jsquery_out() or teach jsquery_in() to accept the above format.
Thanks,
Pavan
jsquery_in_out.txt
Currently we are evaluating jsquery to be used in long-term project. So:
I known about http://obartunov.livejournal.com/179422.html but do you have any plans for supporting it? Updating to next (9.5) releases?
Could you advice any other solution which allows to store some kind of predicate for JSONB field as separated "object' (field, text, etc)
It would be cool to have jspath function (jsonb, text)->jsonb[],
which work like simplified xpath
jspath('{"a": {"b" :[{"c": any},{"c", any2}]}}', ' "a"."b".#."c" '))
=> {any, any2}
Чё ж на русском документации нету ?
Thank you for a great product. I am having problems where jsquery is not using the gin index.
Given this table and index
\d vertex
Table "public.vertex"
Column | Type | Collation | Nullable | Default
--------+-------------------+-----------+----------+---------
gid | character varying | | not null |
label | character varying | | not null |
data | jsonb | | |
Indexes:
"vertex_data" gin (data)
"vertex_gid" btree (gid)
"vertex_label" btree (label)
This standard jsonb query uses index
explain select gid, data->'start' as "start", data->'chromosome' from vertex where label = 'Allele' and data @> '{"start": 35305275}' or data @> '{"start": 35305277}' ;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------
Bitmap Heap Scan on vertex (cost=225.56..36911.68 rows=9623 width=106)
Recheck Cond: ((data @> '{"start": 35305275}'::jsonb) OR (data @> '{"start": 35305277}'::jsonb))
Filter: ((((label)::text = 'Allele'::text) AND (data @> '{"start": 35305275}'::jsonb)) OR (data @> '{"start": 35305277}'::jsonb))
-> BitmapOr (cost=225.56..225.56 rows=11300 width=0)
-> Bitmap Index Scan on vertex_data (cost=0.00..110.38 rows=5650 width=0)
Index Cond: (data @> '{"start": 35305275}'::jsonb)
-> Bitmap Index Scan on vertex_data (cost=0.00..110.38 rows=5650 width=0)
Index Cond: (data @> '{"start": 35305277}'::jsonb)
(8 rows)
This query does not use the index.
explain select gid, data->'start' as "start", data->'chromosome' from vertex where label = 'Allele' and data @@ 'start = 35305275 OR start = 35305277' ;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------
Seq Scan on vertex (cost=0.00..293886.85 rows=3977 width=106)
Filter: ((data @@ '("start" = 35305275 OR "start" = 35305277)'::jsquery) AND ((label)::text = 'Allele'::text))
(2 rows)
Adding hints does not help
explain select gid, data->'start' as "start", data->'chromosome' from vertex where label = 'Allele' and data @@ 'start /*-- index */ = 35305275 OR start /*-- index */ = 35305277' ;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------
Seq Scan on vertex (cost=0.00..293886.85 rows=3977 width=106)
Filter: ((data @@ '("start" /*-- index */ = 35305275 OR "start" /*-- index */ = 35305277)'::jsquery) AND ((label)::text = 'Allele'::text))
(2 rows)
I'd really like to use jsquery for queries on the form
explain select gid, data->'start' as "start", data->'chromosome' from vertex where label = 'Allele' and data @@ 'start ($ > 35305274 AND $ < 35305278) ';
QUERY PLAN
--------------------------------------------------------------------------------------------------------------
Seq Scan on vertex (cost=0.00..293886.85 rows=3977 width=106)
Filter: ((data @@ '"start"($ > 35305275 AND $ < 35305277)'::jsquery) AND ((label)::text = 'Allele'::text))
(2 rows)
Hi,
jsquery latest release fails to build against v16. v16 is due next week. Will you release a new version?
...or a better question: Is this extension being maintained?
Regards, Devrim
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I./ -I/usr/pgsql-16/include/server -I/usr/pgsql-16/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsonb_gin_ops.bc jsonb_gin_ops.c
In file included from /usr/pgsql-16/include/server/utils/elog.h:19,
from /usr/pgsql-16/include/server/postgres.h:46,
from jsquery_support.c:15:
jsquery_support.c: In function 'alignStringInfoInt':
/usr/pgsql-16/include/server/lib/stringinfo.h:130:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
129 | (((str)->len + 1 >= (str)->maxlen) ?
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130 | appendStringInfoChar(str, ch) :
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
131 | (void)((str)->data[(str)->len] = (ch), (str)->data[++(str)->len] = '\0'))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_support.c:35:25: note: in expansion of macro 'appendStringInfoCharMacro'
35 | appendStringInfoCharMacro(buf, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_support.c:36:17: note: here
36 | case 2:
| ^~~~
/usr/pgsql-16/include/server/lib/stringinfo.h:130:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
129 | (((str)->len + 1 >= (str)->maxlen) ?
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130 | appendStringInfoChar(str, ch) :
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
131 | (void)((str)->data[(str)->len] = (ch), (str)->data[++(str)->len] = '\0'))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_support.c:37:25: note: in expansion of macro 'appendStringInfoCharMacro'
37 | appendStringInfoCharMacro(buf, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_support.c:38:17: note: here
38 | case 1:
| ^~~~
jsquery_support.c: In function 'jsqInitByBuffer':
jsquery_support.c:63:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
63 | case 3: pos++;
| ~~~^~
jsquery_support.c:64:17: note: here
64 | case 2: pos++;
| ^~~~
jsquery_support.c:64:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
64 | case 2: pos++;
| ~~~^~
jsquery_support.c:65:17: note: here
65 | case 1: pos++;
| ^~~~
jsquery_support.c:26:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
26 | (p) += sizeof(int32);
| ~~~~^~~~~~~~~~~~~~~~
jsquery_support.c:88:25: note: in expansion of macro 'read_int32'
88 | read_int32(v->value.datalen, base, pos);
| ^~~~~~~~~~
jsquery_support.c:90:17: note: here
90 | case jqiNumeric:
| ^~~~
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I./ -I/usr/pgsql-16/include/server -I/usr/pgsql-16/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_constr.bc jsquery_constr.c
In file included from /usr/pgsql-16/include/server/utils/builtins.h:17,
from jsquery_io.c:18:
jsquery_io.c: In function 'jsquery_out':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_io.c:400:39: note: in expansion of macro 'PG_GETARG_JSQUERY'
400 | JsQuery *in = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
In file included from jsquery_io.c:15:
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena '
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_io.c: In function 'flattenJsQueryParseItem':
jsquery_io.c:45:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
45 | if (onlyCurrentInPath)
| ^
jsquery_io.c:47:17: note: here
47 | case jqiString:
| ^~~~
jsquery_io.c:118:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
118 | appendBinaryStringInfo(buf, (char)&item->arrayIndex,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119 | sizeof(item->arrayIndex));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_io.c:120:17: note: here
120 | case jqiAny:
| ^~~~
jsquery_io.c: In function 'printJsQueryItem':
jsquery_io.c:239:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
239 | if (inKey)
| ^
jsquery_io.c:242:17: note: here
242 | case jqiString:
| ^~~~
In file included from /usr/pgsql-16/include/server/utils/builtins.h:17,
from jsquery_constr.c:18:
jsquery_constr.c: In function 'jsquery_join_and':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_constr.c:196:32: note: in expansion of macro 'PG_GETARG_JSQUERY'
196 | JsQuery *jq1 = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
In file included from jsquery_constr.c:15:
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_constr.c:197:32: note: in expansion of macro 'PG_GETARG_JSQUERY'
197 | JsQuery *jq2 = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_constr.c: In function 'jsquery_join_or':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_constr.c:212:32: note: in expansion of macro 'PG_GETARG_JSQUERY'
212 | JsQuery *jq1 = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_constr.c:213:32: note: in expansion of macro 'PG_GETARG_JSQUERY'
213 | JsQuery *jq2 = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_constr.c: In function 'jsquery_not':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_constr.c:228:39: note: in expansion of macro 'PG_GETARG_JSQUERY'
228 | JsQuery *jq = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_extract.c: In function 'recursiveExtract':
jsquery_extract.c:170:33: warning: this statement may fall through [-Wimplicit-fallthrough=]
170 | else if (e.type != jqiArray)
| ^
jsquery_extract.c:182:17: note: here
182 | case jqiIn:
| ^~~~
jsquery_op.c: In function 'recursiveExecute':
jsquery_op.c:545:57: warning: variable 'r' set but not used [-Wunused-but-set-variable]
545 | int32 r;
| ^
jsquery_op.c:732:57: warning: variable 'r' set but not used [-Wunused-but-set-variable]
732 | int32 r;
| ^
In file included from /usr/pgsql-16/include/server/utils/builtins.h:17,
from jsquery_op.c:18:
jsquery_op.c: In function 'jsquery_json_exec':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:784:39: note: in expansion of macro 'PG_GETARG_JSQUERY'
784 | JsQuery *jq = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
In file included from jsquery_op.c:15:
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'json_jsquery_exec':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:809:39: note: in expansion of macro 'PG_GETARG_JSQUERY'
809 | JsQuery *jq = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'json_jsquery_filter':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:833:39: note: in expansion of macro 'PG_GETARG_JSQUERY'
833 | JsQuery *jq = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'jsquery_cmp':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:978:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
978 | JsQuery *jq1 = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:979:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
979 | JsQuery *jq2 = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'jsquery_lt':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:998:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
998 | JsQuery *jq1 = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:999:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
999 | JsQuery *jq2 = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'jsquery_le':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1018:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1018 | JsQuery *jq1 = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1019:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1019 | JsQuery *jq2 = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'jsquery_eq':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1038:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1038 | JsQuery *jq1 = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1039:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1039 | JsQuery *jq2 = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'jsquery_ne':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1058:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1058 | JsQuery *jq1 = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1059:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1059 | JsQuery *jq2 = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'jsquery_ge':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1078:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1078 | JsQuery *jq1 = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1079:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1079 | JsQuery *jq2 = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'jsquery_gt':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1098:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1098 | JsQuery *jq1 = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1099:40: note: in expansion of macro 'PG_GETARG_JSQUERY'
1099 | JsQuery *jq2 = PG_GETARG_JSQUERY(1);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsquery_op.c: In function 'jsquery_hash':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsquery_op.c:1200:39: note: in expansion of macro 'PG_GETARG_JSQUERY'
1200 | JsQuery *jq = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
In file included from /usr/pgsql-16/include/server/access/skey.h:19,
from /usr/pgsql-16/include/server/access/genam.h:18,
from /usr/pgsql-16/include/server/access/amapi.h:15,
from /usr/pgsql-16/include/server/access/hash.h:20,
from jsonb_gin_ops.c:17:
jsonb_gin_ops.c: In function 'gin_debug_query_value_path':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsonb_gin_ops.c:751:14: note: in expansion of macro 'PG_GETARG_JSQUERY'
751 | jq = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
In file included from jsonb_gin_ops.c:15:
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsonb_gin_ops.c: In function 'gin_extract_jsonb_query_value_path':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsonb_gin_ops.c:795:30: note: in expansion of macro 'PG_GETARG_JSQUERY'
795 | jq = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsonb_gin_ops.c: In function 'gin_debug_query_path_value':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsonb_gin_ops.c:1191:14: note: in expansion of macro 'PG_GETARG_JSQUERY'
1191 | jq = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
jsonb_gin_ops.c: In function 'gin_extract_jsonb_query_path_value':
/usr/pgsql-16/include/server/fmgr.h:241:9: warning: passing argument 1 of 'DatumGetPointer' makes integer from pointer without a cast [-Wint-conversion]
241 | pg_detoast_datum((struct varlena ) DatumGetPointer(datum))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct varlena *
jsquery.h:28:60: note: in expansion of macro 'PG_DETOAST_DATUM'
28 | #define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
| ^~~~~~~~~~~~~~~~
jsquery.h:29:33: note: in expansion of macro 'DatumGetJsQueryP'
29 | #define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
| ^~~~~~~~~~~~~~~~
jsonb_gin_ops.c:1220:30: note: in expansion of macro 'PG_GETARG_JSQUERY'
1220 | jq = PG_GETARG_JSQUERY(0);
| ^~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'struct varlena *'
312 | DatumGetPointer(Datum X)
| ~~~~~~^
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I./ -I/usr/pgsql-16/include/server -I/usr/pgsql-16/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_extract.bc jsquery_extract.c
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I./ -I/usr/pgsql-16/include/server -I/usr/pgsql-16/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_io.bc jsquery_io.c
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I./ -I/usr/pgsql-16/include/server -I/usr/pgsql-16/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_op.bc jsquery_op.c
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I./ -I/usr/pgsql-16/include/server -I/usr/pgsql-16/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_support.bc jsquery_support.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -fvisibility=hidden -I. -I./ -I/usr/pgsql-16/include/server -I/usr/pgsql-16/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o jsquery_gram.o jsquery_gram.c
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I./ -I/usr/pgsql-16/include/server -I/usr/pgsql-16/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_gram.bc jsquery_gram.c
jsquery_constr.c:196:18: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq1 = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_constr.c:197:18: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq2 = PG_GETARG_JSQUERY(1);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_constr.c:212:18: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq1 = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_constr.c:213:18: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq2 = PG_GETARG_JSQUERY(1);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_constr.c:228:18: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
5 errors generated.
make[1]: *** [/usr/pgsql-16/lib/pgxs/src/makefiles/../../src/Makefile.global:1080: jsquery_constr.bc] Error 1
make[1]: *** Waiting for unfinished jobs....
jsonb_gin_ops.c:751:7: error: incompatible pointer to integer conversion passing 'struct varlena ' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
jq = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsonb_gin_ops.c:795:9: error: incompatible pointer to integer conversion passing 'struct varlena ' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
jq = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsonb_gin_ops.c:1191:7: error: incompatible pointer to integer conversion passing 'struct varlena ' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
jq = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsonb_gin_ops.c:1220:9: error: incompatible pointer to integer conversion passing 'struct varlena ' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
jq = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
4 errors generated.
make[1]: *** [/usr/pgsql-16/lib/pgxs/src/makefiles/../../src/Makefile.global:1080: jsonb_gin_ops.bc] Error 1
jsquery_io.c:400:18: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery in = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
1 error generated.
make[1]: *** [/usr/pgsql-16/lib/pgxs/src/makefiles/../../src/Makefile.global:1080: jsquery_io.bc] Error 1
jsquery_op.c:784:18: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_op.c:809:18: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq = PG_GETARG_JSQUERY(1);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_op.c:833:18: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq = PG_GETARG_JSQUERY(1);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_op.c:978:19: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq1 = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_op.c:979:19: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq2 = PG_GETARG_JSQUERY(1);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_op.c:998:19: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq1 = PG_GETARG_JSQUERY(0);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/fmgr.h:241:2: note: expanded from macro 'PG_DETOAST_DATUM'
pg_detoast_datum((struct varlena *) DatumGetPointer(datum))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-16/include/server/postgres.h:312:23: note: passing argument to parameter 'X' here
DatumGetPointer(Datum X)
^
jsquery_op.c:999:19: error: incompatible pointer to integer conversion passing 'struct varlena *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
JsQuery jq2 = PG_GETARG_JSQUERY(1);
^~~~~~~~~~~~~~~~~~~~
./jsquery.h:29:30: note: expanded from macro 'PG_GETARG_JSQUERY'
#define PG_GETARG_JSQUERY(x) DatumGetJsQueryP(PG_GETARG_DATUM(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./jsquery.h:28:56: note: expanded from macro 'DatumGetJsQueryP'
#define DatumGetJsQueryP(d) ((JsQuery)DatumGetPointer(PG_DETOAST_DATUM(d)))
^~~~~~~~~~~~~~~~~~~
For example, jsonb document {"a": [{"b": "xyz", "c": true}, 10], "d": {"e": [7, false]}} would be decomposed into following entries:
"a".#."b"."xyz" "a".#."c".true "a".#.10 "d"."e".#.7 "d"."e".#.false
Since JsQuery doesn't support search in particular array index, we consider all array elements to be equivalent. Thus, each array element is marked with same # sign in the path.
If this is true then how do you make the distinction between two different arrays at the same level? Something like [[1,2,3][4,5,6]] would result in:
#.#.1
#.#.2
#.#.3
#.#.4
#.#.5
#.#.6
which makes the distinction impossible even though containment is respected by jsquery.
I had to install a couple other packages
sudo apt-get install postgresql-server-dev-all
sudo apt-get install flex
sudo apt-get install bison
Build on Ubuntu 14 and Postgres 9.5
~/jsquery$ make USE_PGXS=1
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer -fpic -I. -I./ -I/usr/include/postgresql/9.5/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o jsquery_gram.o jsquery_gram.c
jsquery_gram.y:50:26: fatal error: jsquery_gram.h: No such file or directory
#include <jsquery_gram.h>
Hey, first of all your work on Postgres is amazing guys!
Do you know (approximately) when Jsquery will be available along with Postgres (9.5, 9.6?). Also could you tell what is actual status of VODKA indexes? Will VODKA indexes also be "merged" to Postgres?
Thanks for your work!
I'm getting an error building against 9.5devel:
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O2 -fpic -I. -I. -I../../src/include -D_GNU_SOURCE -c -o jsquery_op.o jsquery_op.c -MMD -MP -MF .deps/jsquery_op.Po
jsquery_op.c:20:27: fatal error: common/pg_crc.h: No such file or directory
#include "common/pg_crc.h"
^
compilation terminated.
make: *** [jsquery_op.o] Error 1
pg_crc.h was initially moved to common, but is now back in utils (shown here), and this is now working for me with:
diff --git a/jsquery_op.c b/jsquery_op.c
index 1b3fd0d..e011c6a 100644
--- a/jsquery_op.c
+++ b/jsquery_op.c
@@ -17,14 +17,13 @@
#include "miscadmin.h"
#include "utils/builtins.h"
#if PG_VERSION_NUM >= 90500
-#include "common/pg_crc.h"
#define COMP_CRC32 COMP_CRC32C
#define INIT_CRC32 INIT_CRC32C
#define FIN_CRC32 FIN_CRC32C
#define INIT_CRC32 INIT_CRC32C
#else
-#include "utils/pg_crc.h"
#endif
+#include "utils/pg_crc.h"
#include "jsquery.h"
Hi,
jsqıery fails to build against GCC 13 (Fedora 38). Can you please take a look? Thanks!
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 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o jsquery_support.o jsquery_support.c
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2 -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsonb_gin_ops.bc jsonb_gin_ops.c
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2 -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_constr.bc jsquery_constr.c
In file included from /usr/pgsql-15/include/server/access/gin.h:14,
from jsquery.h:18,
from jsquery_support.c:17:
jsquery_support.c: In function 'alignStringInfoInt':
/usr/pgsql-15/include/server/lib/stringinfo.h:130:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
129 | (((str)->len + 1 >= (str)->maxlen) ? \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130 | appendStringInfoChar(str, ch) : \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
131 | (void)((str)->data[(str)->len] = (ch), (str)->data[++(str)->len] = '\0'))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_support.c:35:25: note: in expansion of macro 'appendStringInfoCharMacro'
35 | appendStringInfoCharMacro(buf, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_support.c:36:17: note: here
36 | case 2:
| ^~~~
/usr/pgsql-15/include/server/lib/stringinfo.h:130:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
129 | (((str)->len + 1 >= (str)->maxlen) ? \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130 | appendStringInfoChar(str, ch) : \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
131 | (void)((str)->data[(str)->len] = (ch), (str)->data[++(str)->len] = '\0'))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_support.c:37:25: note: in expansion of macro 'appendStringInfoCharMacro'
37 | appendStringInfoCharMacro(buf, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_support.c:38:17: note: here
38 | case 1:
| ^~~~
jsquery_support.c: In function 'jsqInitByBuffer':
jsquery_support.c:63:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
63 | case 3: pos++;
| ~~~^~
jsquery_support.c:64:17: note: here
64 | case 2: pos++;
| ^~~~
jsquery_support.c:64:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
64 | case 2: pos++;
| ~~~^~
jsquery_support.c:65:17: note: here
65 | case 1: pos++;
| ^~~~
jsquery_support.c:26:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
26 | (p) += sizeof(int32); \
| ~~~~^~~~~~~~~~~~~~~~
jsquery_support.c:88:25: note: in expansion of macro 'read_int32'
88 | read_int32(v->value.datalen, base, pos);
| ^~~~~~~~~~
jsquery_support.c:90:17: note: here
90 | case jqiNumeric:
| ^~~~
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2 -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_extract.bc jsquery_extract.c
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2 -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_gram.bc jsquery_gram.c
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2 -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_io.bc jsquery_io.c
jsquery_io.c: In function 'flattenJsQueryParseItem':
jsquery_io.c:45:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
45 | if (onlyCurrentInPath)
| ^
jsquery_io.c:47:17: note: here
47 | case jqiString:
| ^~~~
jsquery_io.c:118:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
118 | appendBinaryStringInfo(buf, (char*)&item->arrayIndex,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119 | sizeof(item->arrayIndex));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
jsquery_io.c:120:17: note: here
120 | case jqiAny:
| ^~~~
jsquery_io.c: In function 'printJsQueryItem':
jsquery_io.c:239:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
239 | if (inKey)
| ^
jsquery_io.c:242:17: note: here
242 | case jqiString:
| ^~~~
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2 -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_op.bc jsquery_op.c
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2 -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o jsquery_support.bc jsquery_support.c
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 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o jsquery_gram.o jsquery_gram.c
jsquery_gram.y:73:18: error: call to undeclared function 'pg_atoi'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
v->arrayIndex = pg_atoi(s->val, 4, 0);
^
1 error generated.
make[1]: *** [/usr/pgsql-15/lib/pgxs/src/makefiles/../../src/Makefile.global:1081: jsquery_gram.bc] Error 1
make[1]: *** Waiting for unfinished jobs....
jsquery_op.c: In function 'recursiveExecute':
jsquery_op.c:545:57: warning: variable 'r' set but not used [-Wunused-but-set-variable]
545 | int32 r;
| ^
jsquery_op.c:732:57: warning: variable 'r' set but not used [-Wunused-but-set-variable]
732 | int32 r;
| ^
jsquery_extract.c: In function 'recursiveExtract':
jsquery_extract.c:170:33: warning: this statement may fall through [-Wimplicit-fallthrough=]
170 | else if (e.type != jqiArray)
| ^
jsquery_extract.c:182:17: note: here
182 | case jqiIn:
| ^~~~
jsquery_gram.y: In function 'makeIndexArray':
jsquery_gram.y:73:25: warning: implicit declaration of function 'pg_atoi'; did you mean 'pg_ltoa'? [-Wimplicit-function-declaration]
73 | v->arrayIndex = pg_atoi(s->val, 4, 0);
| ^~~~~~~
| pg_ltoa
make[1]: Leaving directory '/Projects/repo/pgrpms/rpm/redhat/main/non-common/jsquery/main/jsquery-ver_1.1.1'
error: Bad exit status from /var/tmp/rpm-tmp.ckoFhH (%build)
Hi,
could we have a new release with PG12 support so I can update the Debian packages?
Thanks!
Here is steps for issue reproducing.
Every "execute" performs successfully until 6th try.
Reproduced at PostgreSQL version 10.5, jsquery version 1.1.0.
create extension jsquery;
prepare a as (select $1::text::jsquery);
execute a('');
execute a('');
execute a('');
execute a('');
execute a('');
execute a('');
create database test;
\c test
create extension jsquery;
create table test(j jsonb);
insert into test values ('{"id":1,"test":"test"}');
CREATE OR REPLACE FUNCTION has_test(j jsonb) RETURNS boolean
LANGUAGE plpgsql IMMUTABLE
AS $$
DECLARE
ret boolean;
BEGIN
SELECT $1 @@ '$.test = test' into ret;
return ret;
END;
$$;
CREATE INDEX test_index_plpgsql -- does't work in vacuum
ON test
USING btree
(has_test(j));
CREATE INDEX test_index_clear -- works fine
ON test
((j->>'id'))
WHERE j @@ '$.test = test';
vacuumdb -fzv --dbname=test
vacuumdb: vacuuming database "test"
INFO: vacuuming "public.test"
INFO: "test": found 0 removable, 1 nonremovable row versions in 1 pages
DETAIL: 0 dead row versions cannot be removed yet.
CPU: user: 0.01 s, system: 0.00 s, elapsed: 0.01 s.
vacuumdb: vacuuming of database "test" failed: ERROR: operator does not exist: jsonb @@ unknown
LINE 1: SELECT
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
QUERY: SELECT
CONTEXT: PL/pgSQL function public.has_test(jsonb) line 5 at SQL statement
ii postgresql-11 11.0-1.pgdg16.04+2 amd64
Package: postgresql-11
Status: install ok installed
Priority: optional
Section: database
Installed-Size: 43753
Maintainer: Debian PostgreSQL Maintainers [email protected]
Architecture: amd64
Version: 11.0-1.pgdg16.04+2
Provides: postgresql-contrib-11
Homepage: http://www.postgresql.org/
Postgresql-Catversion: 201809051
ii postgresql-11-jsquery 1.1.1-1.pgdg16.04+1 amd64
apt-cache show postgresql-11-jsquery
Package: postgresql-11-jsquery
Source: jsquery
Version: 1.1.1-1.pgdg16.04+1
Architecture: amd64
Maintainer: Debian PostgreSQL Maintainers [email protected]
Installed-Size: 290
Depends: postgresql-11, libc6 (>= 2.14)
Homepage: https://github.com/postgrespro/jsquery
Priority: optional
Section: database
Filename: pool/main/j/jsquery/postgresql-11-jsquery_1.1.1-1.pgdg16.04+1_amd64.deb
Size: 127560
SHA256: b6fdd08d91b83ca5ababe56af3c58dc2891a940102f838313d9f2bbcb8647974
SHA1: 88cab2e08e988ceb1811a82b3aec4c9f6838af44
MD5sum: 586f57fe09dd34c397ee17d2e17d2a95
ii postgresql-common 195.pgdg16.04+1 all
for pg9 - no problem
This happens when loading the extension (compiling it works without warning nor error):
tmp=# create extension jsquery;
ERROR: could not load library "/think/cs/re/2022-11-DB15_rh7/lib/postgresql/jsquery.so": /think/cs/re/2022-11-DB15_rh7/lib/postgresql/jsquery.so: undefined symbol: pg_atoi
Grepping for pg_atoi in pg 15's sources comes up empty, so it seems this symbol was removed.
Compiling jsquery did not raise any warnings, though.
Hi, is it possible to install the extension to a system running PostgreSQL 9.6? I'm trying to do it on a system where I have 'bison' version 2.7 installed but it prints the following error after running the command $ make USE_PGXS=1
:
ERROR: bison is missing on your system. It is needed to create the
file `jsquery_gram.c'. You can either get bison from a GNU mirror site
or download an official distribution of PostgreSQL, which contains
pre-packaged bison output.
Could i construct path using concrete index in array:
'{"a":[{"b":1},{"b":2}]}' @@ 'a.0.b = 1'
I've tried to build jsquery with 9.4 and 9.5, but it failed with:
jsquery_gram.y:56:5: error: conflicting types for 'jsquery_yyparse'
int jsquery_yyparse(void *result);
^
In file included from jsquery_gram.y:52:0:
jsquery_gram.h:85:5: note: previous declaration of 'jsquery_yyparse' was here
int jsquery_yyparse (void);
^
jsquery_gram.y: In function 'jsquery_yyparse':
jsquery_gram.y:228:29: error: 'result' undeclared (first use in this function)
expr { *((JsQueryParseItem**)result) = $1; }
^
jsquery_gram.y:228:29: note: each undeclared identifier is reported only once for each function it appears in
make: *** [jsquery_gram.o] Error 1
Which version of postgresql || jsquery should i use?
I could help setup travis ci to track build status ( like here https://github.com/fhirbase/fhirbase/blob/master/.travis.yml)
I'm trying to test the extension under macOS but failing miserably.
Essentially, I can't even build the extension:
$ env USE_PGXS=1 make
make: Nothing to be done for `all'.
$
Was extension not meant to be installed under macOS?
I'm pretty sure versions of installed software have nothing to do the problem, but to give a little more insight into my env, here they are:
Hi
I try to run the regression tests after installing jsquery and it fails with the error message
>>
+ERROR: operator is not unique: jsonb @@ unknown
+LINE 1: select '{"a": {"b": 1}}'::jsonb @@ 'a.* > 0';
+HINT: Could not choose a best candidate operator. You might need to add explicit type casts.
<<
Can you help me to solve this problem ?
Thanks in advance
I see how I can use the jsquery @@
operator in a WHERE
clause or in a CHECK
constraint. Is there an operator in either of the opclasses which would allow the use of the index in an ORDER BY
clause? For example, suppose I have a table full of jsonb documents which look like:
{"time":1430432587, "place":"zoo", "animal_counts":{"monkeys":77, "tigers":3, "elephants":9.4}}
I would like to sort by animal_counts.tigers
and I would like that sort to use the index.
create extension if not exists jsquery;
drop table if exists contained_test;
create table contained_test (data jsonb);
insert into contained_test values ('{"id": 1}'), ('{"id": 2}');
select * from contained_test where data @@ 'id IN (1, 2)'::jsquery; -- works, returning both records
select * from contained_test where data @@ 'id <@ [1, 2]'::jsquery; -- does not work, returning 0 rows
Using Jsquery 1.0 (compiled few days ago from master).
In readme it states that Jsquery supports "contained in" (<@) operator. Am I doing something wrong?
Hi
I try to installing jsquery and it fails with the error message
[make USE_PGXS=1](make: *** [/usr/lib/postgresql/16/lib/pgxs/src/makefiles/../../src/Makefile.global:792: jsquery_gram.c] Error 127)
CREATE TABLE js_test ( js jsonb );
INSERT INTO js_test (js) VALUES ('{"test":[12]}');
SELECT * FROM js_test WHERE js @@ 'test.# IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49)';
Данная серия запросов приводит к тому, что база уходит в recovery mode. Причём, проблема возникает только если количество параметров в IN больше 48.
Надеюсь на вашу помощь.
PostgreSQL 9.6.3 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit
Can we use this extension on PostgreSQL installations on Red Hat (and variants) Linux.
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.