Re: [HACKERS] compress method for spgist - 2

2017-12-04 Thread Nikita Glukhov
with feedback. Rebased patches are attached. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company >From 1c251ff129f8e9f33d14df547d97ba549b109648 Mon Sep 17 00:00:00 2001 From: Nikita Glukhov <n.glu...@postgrespro.ru> Date: Tue, 5 Dec 2017 02:38

Re: compress method for spgist - 2

2017-12-06 Thread Nikita Glukhov
On 06.12.2017 21:49, Alexander Korotkov wrote: On Wed, Dec 6, 2017 at 6:08 PM, Nikita Glukhov <n.glu...@postgrespro.ru <mailto:n.glu...@postgrespro.ru>> wrote: On 05.12.2017 23:59, Alexander Korotkov wrote: On Tue, Dec 5, 2017 at 1:14 PM, Darafei Praliaskouski <

Re: compress method for spgist - 2

2017-12-06 Thread Nikita Glukhov
Fixed patch is attached. Also, I wonder should we check for existence of compress method when attType and leafType are not the same in spgvalidate() function?  We don't do this for now. I've added compress method existence check to spgvalidate(). 0002-spgist-polygon-8.patch is OK for me so soon.

[BUGFIX] amcanbackward is not checked before building backward index paths

2018-05-15 Thread Nikita Glukhov
. Obviously, this can lead to misuse of Backward Index [Only] Scan plans. Attached patch with the corresponding fix. There are no test cases because now only btree supports ordered scans but it supports backward scans too. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian

Re: Jsonb transform for pl/python

2018-06-15 Thread Nikita Glukhov
On 28.03.2018 15:43, Peter Eisentraut wrote: On 3/21/18 18:50, Peter Eisentraut wrote: On 3/12/18 11:26, Nikita Glukhov wrote: I have reviewed this patch. Attached new 6th version of the patch with v5-v6 delta-patch. Thanks for the update. I'm working on committing this. Committed

Re: jsonpath

2018-07-02 Thread Nikita Glukhov
On 28.06.2018 05:39, Thomas Munro wrote: On Thu, Jun 28, 2018 at 11:38 AM, Nikita Glukhov wrote: Attached 15th version of the patches. Hi Nikita, I wonder why the Windows build scripts are not finding and processing your new .y and .l files: https://ci.appveyor.com/project/postgresql-cfbot

Re: jsonpath

2018-06-27 Thread Nikita Glukhov
been moved into a separate patch (see https://www.postgresql.org/message-id/732208d3-56c3-25a4-8f08-3be1d54ad51b%40postgrespro.ru). -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company sqljson_jsonpath_v15.tar.gz Description: application/gzip

Re: Psql patch to show access methods info

2018-06-25 Thread Nikita Glukhov
s not so easy to understand the combined table. The same, perhaps, can be applied to \dAfp and \dAfo commands. I also have a question about testing commands \dAf+ and \dAoc+: is it good idea to test them by changing an owner of one operator family or class to created new one, checking the ou

Re: [HACKERS] [PATCH] kNN for SP-GiST

2018-07-03 Thread Nikita Glukhov
Attached 5th version of the patches, where minor refactoring of distance handling was done (see below). On 02.07.2018 19:06, Alexander Korotkov wrote: Hi! On Fri, Jun 29, 2018 at 5:37 PM Nikita Glukhov wrote: On 06.03.2018 17:30, David Steele wrote: I agree with Andres. Pushing

Re: to_timestamp TZH and TZM format specifiers

2018-01-07 Thread Nikita Glukhov
usive. Let RYLIT be an of four s whose value is RY. v) Let RRPREFIX be the first (4 – RRLEN) digits of RYLIT. NOTE 472 — If the length of RRSTR is 4, then RRPREFIX is a zero-length  string. vi) Let be the result of RRPREFIX || RRSTR vii)

Re: [HACKERS] SQL/JSON in PostgreSQL

2018-01-06 Thread Nikita Glukhov
On 07.01.2018 00:33, Pavel Stehule wrote: 2018-01-06 22:23 GMT+01:00 Nikita Glukhov <n.glu...@postgrespro.ru <mailto:n.glu...@postgrespro.ru>>: On 07.01.2018 00:22, Pavel Stehule wrote: Hi I try jsonpath on json {

Re: [HACKERS] SQL/JSON in PostgreSQL

2018-01-06 Thread Nikita Glukhov
m test; ┌──┐ │ ?column? │ ╞══╡ └──┘ (0 rows) I found some examples, where the filter has bigger sense, but it is not supported LINE 1: select j @* '$.book[?(@.price==6.00)].title' from test;     ^ DETAIL:  syntax error, unexpected '?' at or near "?" ".title" simply should go after the filter: select j @* '$.book[*] ? (@.price==6.00).title' from test; -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [HACKERS] SQL/JSON in PostgreSQL

2018-01-06 Thread Nikita Glukhov
should introduce new node like TableFunc (or also we can try to use existing JSON_TABLE infrastructure). Set-returning expressions are not allowed in every context, so for returning singleton items there should be additional operator. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: jsonpath

2018-01-23 Thread Nikita Glukhov
On 23.01.2018 01:41, Andrew Dunstan wrote: On 01/17/2018 04:01 PM, Andrew Dunstan wrote: On 01/15/2018 07:24 PM, Andrew Dunstan wrote: On 01/10/2018 05:42 PM, Nikita Glukhov wrote: Attached new 8th version of jsonpath related patches. Complete documentation is still missing. The first 4

Re: jsonpath

2018-08-22 Thread Nikita Glukhov
Attached 17th version of the patches rebased onto the current master. Nothing significant has changed. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company sqljson_jsonpath_v17.tar.gz Description: application/gzip

Re: [HACKERS] [PATCH] kNN for SP-GiST

2018-07-17 Thread Nikita Glukhov
Attached 7th version of the patches: * renamed recheck fields and variables * fixed formatting of the one if-statement On 15.07.2018 14:54, Andrey Borodin wrote: 14.07.2018, 1:31, Nikita Glukhov wrote: Attached 6th version of the patches. ... 2. The patch leaves contribs intact. Do

Re: [PATCH] Add missing type conversion functions for PL/Python

2018-07-12 Thread Nikita Glukhov
On 11.07.2018 21:03, Heikki Linnakangas wrote: On 26/03/18 19:07, Nikita Glukhov wrote: Attached fixed 3th version of the patch: Thanks, I'm reviewing this now. Nice speedup! Thank you for your review. There is no test coverage for some of the added code. You can get a code coverage

Re: [HACKERS] [PATCH] kNN for SP-GiST

2018-07-13 Thread Nikita Glukhov
Attached  6th version of the patches. On 09.07.2018 20:47, Andrey Borodin wrote: 4 июля 2018 г., в 3:21, Nikita Glukhov написал(а): Attached 5th version of the patches, where minor refactoring of distance handling was done (see below). I'm reviewing this patch. Currently I'm trying

Re: Jsonb transform for pl/python

2018-03-12 Thread Nikita Glukhov
** to PyXxx_ToJsonbValue() functions. * Added transformation of Python tuples into JSON arrays because standard Python JSONEncoder encoder does the same. (See https://docs.python.org/2/library/json.html#py-to-json-table) -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres

Re: [HACKERS] [PATCH] kNN for SP-GiST

2018-02-28 Thread Nikita Glukhov
, so I left only ordering operators for polygons in the last 6th patch. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index f57380a..a4345ef 100644 --- a/src/backend/u

Re: Cast jsonb to numeric, int, float, bool

2018-02-28 Thread Nikita Glukhov
E(jb, '$.key' RETURNING datatype [NULL ON ERROR]). But if we want to have NULL ON ERRORbehavior (which is default in SQL/JSON) in casts, then casts should not throw any errors. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company >From fd71e22f087af2

Re: Cast jsonb to numeric, int, float, bool

2018-03-01 Thread Nikita Glukhov
); json_value (1 row) =# SELECT JSON_VALUE('{}', '$' RETURNING numeric ERROR ON ERROR); ERROR: SQL/JSON scalar required =# SELECT JSON_VALUE('[]', '$' RETURNING numeric ERROR ON ERROR); ERROR: SQL/JSON scalar required -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [PATCH][PROPOSAL] Add enum releation option type

2018-03-01 Thread Nikita Glukhov
[]. This helps not to expose default values definitions (like GIST_BUFFERING_AUTO defined in gistbuild.c). My github repository: https://github.com/glukhovn/postgres/tree/enum-reloptions -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company diff --git

Re: Transform for pl/perl

2018-03-13 Thread Nikita Glukhov
s comment is broken +/* + * plperl_to_jsonb(SV *in) + * + * Transform Jsonb into SV  ---< should be SV to Jsonb + */ +PG_FUNCTION_INFO_V1(plperl_to_jsonb); +Datum Fixed. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company diff --git a/contrib/Makefi

Re: jsonpath

2018-03-15 Thread Nikita Glukhov
Attached 13th version of the jsonpath patches. Syntax of .** accessor (our extension to standard) was changed to become more similar to the syntax of the standard array accessor: .**{2, 5} => .**{2 to 5} .**{3,} => .**{3 to last} -- Nikita Glukhov Postgres Professional

Re: jsonpath

2018-03-07 Thread Nikita Glukhov
On 02.03.2018 00:57, Alexander Korotkov wrote: On Fri, Mar 2, 2018 at 12:40 AM, Nikita Glukhov <n.glu...@postgrespro.ru <mailto:n.glu...@postgrespro.ru>> wrote: On 28.02.2018 06:55, Robert Haas wrote: On Mon, Feb 26, 2018 at 10:34 AM, Nikita Glukhov

Re: jsonpath

2018-03-27 Thread Nikita Glukhov
y two variants described above, but we understand that some future work is necessary to support such standard features in PostgreSQL without having problems with PG_TRY/PG_CATCH. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company sqljson_jsonpath_v14.tar.gz Description: application/gzip

Re: [PATCH] Add missing type conversion functions for PL/Python

2018-03-26 Thread Nikita Glukhov
ons * fixed whitespace -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company diff --git a/src/pl/plpython/plpy_typeio.c b/src/pl/plpython/plpy_typeio.c index d6a6a84..3b874e1 100644 --- a/src/pl/plpython/plpy_typeio.c +++ b/src/pl/plpython/plpy_typei

Re: jsonpath

2018-03-01 Thread Nikita Glukhov
On 28.02.2018 06:55, Robert Haas wrote: On Mon, Feb 26, 2018 at 10:34 AM, Nikita Glukhov <n.glu...@postgrespro.ru> wrote: Attached 10th version of the jsonpath patches. 1. Fixed error handling in arithmetic operators. Now run-time errors in arithmetic operators are catched

Re: [PATCH] Opclass parameters

2018-03-02 Thread Nikita Glukhov
out CREATE INDEX syntax and where to store the opclass parameters. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: jsonpath

2018-03-05 Thread Nikita Glukhov
. regards -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company sqljson_jsonpath_v11.tar.gz Description: application/gzip

Re: SQL/JSON: documentation

2018-06-28 Thread Nikita Glukhov
On 28.06.2018 05:23, Chapman Flack wrote: On 06/27/2018 07:36 PM, Nikita Glukhov wrote: Also it can be found in our sqljson repository on sqljson_doc branch: https://github.com/postgrespro/sqljson/tree/sqljson_doc Perhaps it is my unfamiliarity, but it seems that on lines 1067–1071

Re: [HACKERS] [PATCH] kNN for SP-GiST

2018-06-29 Thread Nikita Glukhov
On 06.03.2018 17:30, David Steele wrote: I agree with Andres. Pushing this patch to the next CF. Attached 4th version of the patches rebased onto the current master. Nothing interesting has changed from the previous version. -- Nikita Glukhov Postgres Professional: http

Re: Jsonb transform for pl/python

2018-09-27 Thread Nikita Glukhov
PM Nikita Glukhov wrote: I found a memory leak in PLySequence_ToJsonbValue(): PyObject returned from PySequence_GetItem() is not released. A bug can be easily reproduced using function roudtrip() from regression test: SELECT roundtrip('[1,2,3]'::jsonb) FROM generate_series(1, 100); Similar

Re: jsonpath

2019-01-21 Thread Nikita Glukhov
'$var' is its ordinal (positive) number in the list of variables. Ids for generated objects are assigned using global counter 'JsonPathExecContext.generatedObjectId' starting from 'number_of_vars + 1'. Corresponding comments will be added in the upcoming version of the patches. -- Nikita Glu

Re: [PATCH] Opclass parameters

2018-12-05 Thread Nikita Glukhov
Attached 3rd version of the patches. On 20.11.2018 14:15, Nikolay Shaplov wrote: В письме от 15 ноября 2018 18:26:43 пользователь Nikita Glukhov написал: Attached 2nd version of the patches. Nothing has changed since March, this is just a rebased version. CREATE INDEX syntax and parameters

Re: Psql patch to show access methods info

2019-03-20 Thread Nikita Glukhov
| | | extended | | Indexes: "x_a_idx" btree (a varchar_ops) - "x_a_idx1" btree (a DESC NULLS LAST) + "x_a_idx1" btree (a DESC NULLS LAST), Clusteratble Access method: heap # I'm not sure "clusterable" makes sense.. regards. -- Nikita Glukhov Postgres Professional:http://www.postgrespro.com The Russian Postgres Company

Re: [PATCH] kNN for btree

2019-03-25 Thread Nikita Glukhov
On 25.03.2019 11:17, David Steele wrote: On 3/15/19 2:11 AM, Nikita Glukhov wrote: Attached 10th versions of the patches. Fixed two bugs in patches 3 and 10 (see below). Patch 3 was extracted from the main patch 5 (patch 4 in v9). This patch no longer applies so marking Waiting on Author

Fix memleaks and error handling in jsonb_plpython

2019-02-28 Thread Nikita Glukhov
only in OOM case. Attached patch with the fix. Back-patch for PG11 is needed. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company >From e40a9012c38c3b66888791d3dd3943adf9f310c8 Mon Sep 17 00:00:00 2001 From: Nikita Glukhov Date: Tue, 15 Jan 2019 02

Re: SQL/JSON: JSON_TABLE

2019-03-01 Thread Nikita Glukhov
On 01.03.2019 19:17, Robert Haas wrote: On Thu, Feb 28, 2019 at 8:19 PM Nikita Glukhov wrote: Attached 34th version of the patches. Kinda strange version numbering -- the last post on this thread is v21. For simplicity of dependence tracking, version numbering of JSON_TABLE patches matches

Re: patch tester symbols

2019-03-06 Thread Nikita Glukhov
I included it into this patch set just for testing in patch-tester (I guess patch-tester cannot handle patch dependencies). If you apply SQL/JSON patch sets step by step, then you need to apply only patch 0002 from "SQL/JSON: functions" and "SQL/JSON: JSON_TABLE". -- Nikita Glukh

Re: [PATCH] kNN for btree

2019-03-06 Thread Nikita Glukhov
ch is: Waiting on Author [1] https://www.postgresql.org/message-id/CAPpHfdstf812dYObwMeu54P5HijHgURNdoJRc3jKxRj2LsQJRg%40mail.gmail.com -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company 0001-Fix-get_index_column_opclass-v09.patch.gz Description: a

Re: Fix memleaks and error handling in jsonb_plpython

2019-03-05 Thread Nikita Glukhov
On 05.03.2019 6:45, Michael Paquier wrote: On Fri, Mar 01, 2019 at 05:24:39AM +0300, Nikita Glukhov wrote: Unfortunately, contrib/jsonb_plpython still contain a lot of problems in error handling that can lead to memory leaks: - not all Python function calls are checked for the success

Optimization of some jsonb functions

2019-02-21 Thread Nikita Glukhov
.795 | 785.086 -5% js <@ '[0,1,2,3,4,5,6,7,8,9]' | 1214.170 | 1165.289 -5% As it can be seen, #> operators are always slower than equivalent series of ->. I think it is caused by array deconstruction in "jsonb #> text[]". -- Nikita Glukhov Postgres Profe

Re: jsonpath

2019-03-17 Thread Nikita Glukhov
0 -> 'y' = '123' js #> '{x,0,y}' >= '123' also can be estimated (but these expressions can't be used by index on "js"). This topic deserves a separate discussion. I hope, we will start the corresponding thread for PG13 after we find a more effective way of jsonb sta

Add missing operator <->(box, point)

2019-03-10 Thread Nikita Glukhov
t; to SP-GiST. Changed only catalog and tests. Box case is already checked in spg_box_quad_leaf_consistent(): out->recheckDistances = distfnoid == F_DIST_POLYP; -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company >From c2655e83ae0bd7798e5cf

Re: WIP: BRIN multi-range indexes

2019-03-12 Thread Nikita Glukhov
() minmax_multi_get_procinfo() Attached patches with all my changes. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company 0001-Pass-all-keys-to-BRIN-consistent-function-at-once-20190312.patch.gz Description: application/gzip 0002-Move-IS-NOT-NULL-checks

Re: [PATCH] kNN for btree

2019-03-14 Thread Nikita Glukhov
ctions, because they should not care about the length of returned pathkey list, they simply return after the first unsupported pathkey. I event think that ammacthorderby() should not depend on whether we support incremental sorting or not. -- Nikita Glukhov Postgres Professional: http://www.

Re: jsonpath

2019-03-22 Thread Nikita Glukhov
mber v8> .1 0.1 Attached patch 0003 fixes this issue. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company >From 5b0844d77f4fe65d666072356f7c0e42d13c9a63 Mon Sep 17 00:00:00 2001 From: Nikita Glukhov Date: Fri, 22 Mar 2019 14:38:46 +0300 Subject: [PAT

Re: jsonpath

2019-03-21 Thread Nikita Glukhov
path_match( '{ "a": 1, "b": 2,"c": "str" }', '{ "a": 1, "b": @ > 1, * : @.type == "string" }' ) Below are some possible name variants: jsonb_path_predicate() (original name) jsonb_path_pred() jsonb_path_test(

Re: jsonpath

2019-01-28 Thread Nikita Glukhov
some kind of flag 'throwErrors' to jsonb_path_query*() functions. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [PATCH] kNN for btree

2019-07-12 Thread Nikita Glukhov
tion 'int2dist' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return int2dist(fcinfo); ^ btree_int2.c:97:9: note: did you mean 'int2_dist'? btree_int2.c:95:1: note: 'int2_dist' declared here int2_dist(PG_FUNCTION_ARGS) ^ 1 error generated. Fixed. -- Nikita Glukhov Post

Re: Add missing operator <->(box, point)

2019-07-02 Thread Nikita Glukhov
box_ops | spgist | kd_point_ops | <->(point,point) spgist | poly_ops | <->(polygon,point) spgist | quad_point_ops| <->(point,point) (9 rows) We could use commuted "const <-> var" operators for kNN searches, but the current impl

Re: Add missing operator <->(box, point)

2019-07-08 Thread Nikita Glukhov
Attached 3rd version of the patches. On 02.07.2019 21:55, Alexander Korotkov wrote: On Tue, Jul 2, 2019 at 9:19 PM Nikita Glukhov wrote: We could use commuted "const <-> var" operators for kNN searches, but the current implementation requires the existence of "var

Re: [PATCH] kNN for btree

2019-07-01 Thread Nikita Glukhov
On 01.07.2019 13:41, Thomas Munro wrote: On Tue, Mar 26, 2019 at 4:30 AM Nikita Glukhov wrote: Fixed two bugs in patches 3 and 10 (see below). Patch 3 was extracted from the main patch 5 (patch 4 in v9). This patch no longer applies so marking Waiting on Author. Attached 11th version

Re: Avoid full GIN index scan when possible

2019-06-28 Thread Nikita Glukhov
.42 rows=42 width=0) (actual time=0.271..0.271 rows=302 loops=1) Index Cond: ((t ~~ '%1234%'::text) AND (t ~~ '%1%'::text)) Planning Time: 0.080 ms Execution Time: 0.450 ms (8 rows) -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Post

Re: Avoid full GIN index scan when possible

2019-08-02 Thread Nikita Glukhov
ries can be shared, so the reference counting was added. Also modifications of cost estimation in patch #3 are questionable. GinQualCounts are simply not incremented when haveFullScan flag is set, because the counters anyway will be overwritten by the caller. -- Nikita Glukhov Postgres Profess

Re: Bug in GiST paring heap comparator

2019-09-13 Thread Nikita Glukhov
On 12.09.2019 16:45, Alexander Korotkov wrote: On Wed, Sep 11, 2019 at 3:34 AM Nikita Glukhov wrote: On 09.09.2019 22:47, Alexander Korotkov wrote: On Mon, Sep 9, 2019 at 8:32 PM Nikita Glukhov wrote: On 08.09.2019 22:32, Alexander Korotkov wrote: On Fri, Sep 6, 2019 at 5:44 PM Alexander

Re: [PATCH] Opclass parameters

2019-09-10 Thread Nikita Glukhov
On 11.09.2019 1:03, Tomas Vondra wrote: On Tue, Sep 10, 2019 at 04:30:41AM +0300, Nikita Glukhov wrote: 2. New AM method amattoptions().   amattoptions() is used to specify per-column AM-specific options.   The example is signature length for bloom indexes (patch #3). I'm somewhat

Re: Bug in GiST paring heap comparator

2019-09-10 Thread Nikita Glukhov
On 09.09.2019 22:47, Alexander Korotkov wrote: On Mon, Sep 9, 2019 at 8:32 PM Nikita Glukhov wrote: On 08.09.2019 22:32, Alexander Korotkov wrote: On Fri, Sep 6, 2019 at 5:44 PM Alexander Korotkov wrote: I'm going to push both if no objections. So, pushed! Two years ago

Re: [PATCH] Opclass parameters

2019-09-10 Thread Nikita Glukhov
s() at src/backend/commands/opclasscmds.c -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: SQL/JSON: JSON_TABLE

2019-09-16 Thread Nikita Glukhov
one patch. Patch 0001 is simply a squash of all 7 patches from the thread "SQL/JSON: functions". These patches are preliminary for JSON_TABLE. Patch 0002 only needs to be review in this thread. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: Bug in GiST paring heap comparator

2019-09-09 Thread Nikita Glukhov
%40postgrespro.ru Sorry that I looked at this thread too late. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Fix parsing of identifiers in jsonpath

2019-09-18 Thread Nikita Glukhov
cial characters. The patch is not so simple, but I believe that it's not too late to fix v12. [1] https://www.ecma-international.org/ecma-262/10.0/index.html#sec-ecmascript-language-lexical-grammar [2] https://www.ecma-international.org/ecma-262/10.0/index.html#sec-names-and-keywords [3] https://un

Re: Bug in GiST paring heap comparator

2019-09-16 Thread Nikita Glukhov
On 13.09.2019 20:17, Alexander Korotkov wrote: On Fri, Sep 13, 2019 at 5:23 PM Nikita Glukhov wrote: I have moved handling of NULL ordering keys from opclasses to the common SP-GiST code, but really I don't like how it is implemented now. Maybe it's worth to move handling of NULL order

Re: Psql patch to show access methods info

2019-07-22 Thread Nikita Glukhov
cess method properties Name | Type | Handler| Description --+---+--+-- heap | table | heap_tableam_handler | heap table access method (1 row) Columns "Handler" and "Description" were added to \dA+. \dA [NAME] now shows only amname a

Re: fix for BUG #3720: wrong results at using ltree

2019-07-16 Thread Nikita Glukhov
'*{1}.*{1}'; ?column? -- f (1 row) Maybe these two bugs need a separate thread? -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company >From 5334c92406fd281409594a8861cbb40ca9a8c0a9 Mon Sep 17 00:00:00 2001 From: Nikita Glukh

Re: Ltree syntax improvement

2019-07-17 Thread Nikita Glukhov
now because Python list is converted to a text and then to a ltree, and the textual representation of a Python list has become a valid ltree text: SELECT $$['foo', 'bar', 'baz']$$::ltree; ltree - "['foo', 'bar', 'baz']" (1 row)

Re: Support for jsonpath .datetime() method

2019-07-23 Thread Nikita Glukhov
lained somewhere for the readers of the code. [1] https://www.postgresql.org/message-id/885de241-5a51-29c8-a6b3-f1dda22aba13%40postgrespro.ru -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: Psql patch to show access methods info

2019-07-15 Thread Nikita Glukhov
On 01.07.2019 14:06, Thomas Munro wrote: On Sun, Mar 31, 2019 at 2:13 PM wrote: Thanks for review. Hi Sergey, A new Commitfest is here and this doesn't apply -- could you please post a rebase? Thanks, Attached 7th version of the patches rebased onto current master. -- Nikita Glukhov

Re: Bug in GiST paring heap comparator

2019-09-19 Thread Nikita Glukhov
On 19.09.2019 22:14, Alexander Korotkov wrote: Pushed. Attached patch fixes premature xs_orderbynulls[] assignment.  The old value of NULL flag, not the new, should be checked before pfree()ing the old value. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian

Re: Support for jsonpath .datetime() method

2019-09-27 Thread Nikita Glukhov
is expected to be not-NULL always  * fixed errhint() message style [1] https://www.postgresql.org/message-id/32308.1569455803%40sss.pgh.pa.us -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company >From 81d8de2f1d0e0d4ec44729d3d2976b1e63834b14 Mon Sep 17 00

Re: Fix parsing of identifiers in jsonpath

2019-10-02 Thread Nikita Glukhov
Attached v2 patch rebased onto current master. On 18.09.2019 18:10, Nikita Glukhov wrote: Unfortunately, jsonpath lexer, in contrast to jsonpath parser, was written by Teodor and me without a proper attention to the stanard. JSON path lexics is is borrowed from the external ECMAScript [1

Re: SQL/JSON: JSON_TABLE

2019-11-21 Thread Nikita Glukhov
On 17.11.2019 13:35, Pavel Stehule wrote: Hi út 12. 11. 2019 v 22:51 odesílatel Nikita Glukhov mailto:n.glu...@postgrespro.ru>> napsal: On 12.11.2019 20:54, Pavel Stehule wrote: > Hi > > please, can you rebase 0001-SQL-JSON-functions-v40.patch. I have

Re: SQL/JSON: functions

2019-10-21 Thread Nikita Glukhov
On 21.10.2019 19:00, Andrew Alsup wrote: On 9/27/19 9:42 PM, Nikita Glukhov wrote: Attached 39th version of the patches rebased onto current master. I am unable to cleanly apply this patch. I've tried applying to the current master (4f4061b2dd) I've also tried apply to commit b81a9c2fc5 back

Re: Add json_object(text[], json[])?

2019-10-24 Thread Nikita Glukhov
jsonb_object_agg() to build a jsonb object from a sequence of transformed key-value pairs: SELECT COALESCE(jsonb_object_agg(REPLACE(k, '_', '-'), jsonb_dasherize(v)), '{}') INTO ret FROM jsonb_each(j) AS t(k, v); -- Nikita Glukhov Postgres Professional: http

Re: Bug in GiST paring heap comparator

2019-09-24 Thread Nikita Glukhov
On 20.09.2019 0:15, Nikita Glukhov wrote: On 19.09.2019 22:14, Alexander Korotkov wrote: Pushed. Attached patch fixes premature xs_orderbynulls[] assignment.  The old value of NULL flag, not the new, should be checked before pfree()ing the old value. Attached another one-line patch

Re: [PATCH] Opclass parameters

2020-02-28 Thread Nikita Glukhov
Attached new version of the patches. On 12.09.2019 3:16, Tomas Vondra wrote: On Wed, Sep 11, 2019 at 01:44:28AM +0300, Nikita Glukhov wrote: On 11.09.2019 1:03, Tomas Vondra wrote: On Tue, Sep 10, 2019 at 04:30:41AM +0300, Nikita Glukhov wrote: 2. New AM method amattoptions

Re: jsonpath syntax extensions

2020-03-04 Thread Nikita Glukhov
On 04.03.2020 19:13, David Steele wrote: Hi Nikita, On 2/27/20 10:57 AM, Nikita Glukhov wrote: Attached patches implement several useful jsonpath syntax extensions. I already published them two years ago in the original SQL/JSON thread, but then after creation of separate threads for SQL

jsonpath syntax extensions

2020-02-27 Thread Nikita Glukhov
uot;a": "b", "b": "c"}', 'pg $[$.a, "x", "a"]'); jsonb_path_query ------ "c" "b" SELECT jsonb_path_query('{"a": "b", "b": "c"}', 'pg $[$fld]', '{"fld":

Re: Avoid full GIN index scan when possible

2019-12-26 Thread Nikita Glukhov
255 a @> '{}' and b @> '{}' and c @> '{}' | 51 | 58 |290 In the older version of the patch I tried to do the similar things (initialize only one NOT_NULL entry for the first column), but refused to do this in v8. So, to avoid slowdowns relative to master, I can offer simply to ad

Re: Ltree syntax improvement

2020-03-06 Thread Nikita Glukhov
ertainly, but I wonder whether it isn't too confusing. In any case you didn't document that. Embedded whitespace should also be escaped now. I'm also not sure about stripping unquoted leading and trailing whitespace. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The

matchingsel() and NULL-returning operators

2020-04-17 Thread Nikita Glukhov
Seq Scan on test (cost=0.00..17.50 rows=1000 width=5) Filter: (NOT (js @@ '($ == 1)'::jsonpath)) (2 rows) -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company >From 92ff39dca968c5b0c7ac31b0b495780c9a9482a7

Re: Ltree syntax improvement

2020-04-02 Thread Nikita Glukhov
On 02.04.2020 2:46, Tom Lane wrote: Nikita Glukhov writes: [ latest version of ltree syntax extension ] This is going to need another rebase after all the other ltree hacking that just got done. However, I did include 0001 (use a switch) in the commit I just pushed, so you don't need

Re: Ltree syntax improvement

2020-03-26 Thread Nikita Glukhov
On 25.03.2020 2:08, Tom Lane wrote: Nikita Glukhov writes: Attached new version of the patch. I spent a little bit of time looking through this, and have a few comments: * You have a lot of places where tests for particular ASCII characters are done like this: if ((charlen == 1

Re: Ltree syntax improvement

2020-04-03 Thread Nikita Glukhov
On 02.04.2020 19:16, Tom Lane wrote: Nikita Glukhov writes: Rebased patch attached. Thanks for rebasing! The cfbot's not very happy though: 4842ltxtquery_io.c: In function ‘makepol’: 4843ltxtquery_io.c:188:13: error: ‘escaped’ may be used uninitialized in this function [-Werror=maybe

Re: fix for BUG #3720: wrong results at using ltree

2020-03-27 Thread Nikita Glukhov
e same two complaints as Alexander ... On Wed, Jul 17, 2019 at 09:33:46PM +0300, Alexander Korotkov wrote: Hi Nikita, On Tue, Jul 16, 2019 at 6:52 PM Nikita Glukhov wrote: I looked at "ltree syntax improvement" patch and found two more very old bugs in ltree/lquery (fixes are attached): Tha

Re: fix for BUG #3720: wrong results at using ltree

2020-03-30 Thread Nikita Glukhov
On 31.03.2020 1:35, Tom Lane wrote: Nikita Glukhov writes: And we even can simply transform this tail call into a loop: -if (tlen > 0 && qlen > 0) +while (tlen > 0 && qlen > 0) Yeah, the same occurred to me ... and then we can drop the other loop too. I

Re: fix for BUG #3720: wrong results at using ltree

2020-03-30 Thread Nikita Glukhov
can't fall into next "while" loop. The rest code in 0001 and 0002 is unchanged. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company >From b30c07ec318edefdcc9faa6c2158f4bb56114789 Mon Sep 17 00:00:00 2001 From: Nikita Glukhov Date: Tue, 3

Re: fix for BUG #3720: wrong results at using ltree

2020-03-30 Thread Nikita Glukhov
) Let me see what I can do with the comments. Thanks. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: pgsql: Show opclass and opfamily related information in psql

2020-05-14 Thread Nikita Glukhov
On 14.05.2020 12:52, Alexander Korotkov wrote: Nikita, what do you think? I agree that this patch is an improvement. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: [PATCH] Opclass parameters

2020-03-17 Thread Nikita Glukhov
GistAttOptions and GinAttOptions now are included into corresponding structures for opclass options. -- Nikita Glukhov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company 0001-Introduce-opclass-parameters-20200318.patch.gz Description: application/gzip 0002-Use-opclass

Re: SQL/JSON: functions

2020-03-21 Thread Nikita Glukhov
Attached 46th version of the patches. On 20.03.2020 22:34, Pavel Stehule wrote: čt 19. 3. 2020 v 23:57 odesílatel Nikita Glukhov mailto:n.glu...@postgrespro.ru>> napsal: Attached 45th version of the patches. Nodes JsonFormat, JsonReturning, JsonPassing, JsonBehavior were

Re: SQL/JSON: functions

2020-03-23 Thread Nikita Glukhov
Attached 47th version of the patches. On 21.03.2020 22:38, Pavel Stehule wrote: On 21. 3. 2020 v 11:07 Nikita Glukhov <mailto:n.glu...@postgrespro.ru>> wrote: Attached 46th version of the patches. On 20.03.2020 22:34, Pavel Stehule wrote: On 19.03.2020 23:57 Nikit

Fix inconsistency in jsonpath .datetime()

2020-09-19 Thread Nikita Glukhov
work as expected with extra space in earlier version of the patch in which standard mode has not yet been introduced). -- Nikita Glukhov Postgres Professional:http://www.postgrespro.com The Russian Postgres Company >From e867111f4f3525b4d9e3710b7d0db530602793ef Mon Sep 17 00:00:00 2001 From: Ni

Re: SQL/JSON: JSON_TABLE

2021-03-30 Thread Nikita Glukhov
On 30.03.2021 19:56, Erik Rijkers wrote: On 2021.03.27. 02:12 Nikita Glukhov wrote: Attached 47th version of the patches. Hi, Apply, build all fine. It also works quite well, and according to specification, as far as I can tell. But today I ran into: ERROR: function ExecEvalJson

Re: ltree_gist indexes broken after pg_upgrade from 12 to 13

2022-03-04 Thread Nikita Glukhov
updated since such "incomplete" upgrade of ltree. Also I found that contrib/pg_trgm/trgm_gist.c uses wrongly named macro LTREE_GET_ASIGLEN(). -- Nikita Glukhov Postgres Professional:http://www.postgrespro.com The Russian Postgres Company

Re: ltree_gist indexes broken after pg_upgrade from 12 to 13

2022-03-04 Thread Nikita Glukhov
On 04.03.2022 23:28, Tom Lane wrote: Tomas Vondra writes: On 3/4/22 20:29, Nikita Glukhov wrote: So, we probably have corrupted indexes that were updated since such "incomplete" upgrade of ltree. IIRC pg_upgrade is not expected to upgrade extensions - it keeps the install

Re: JSON path decimal literal syntax

2022-03-05 Thread Nikita Glukhov
select '(1).a'::jsonpath::text::jsonpath; ERROR: syntax error, unexpected STRING_P, expecting $end at or near """ of jsonpath input I have added in v3 enclosing of numbers in parentheses if they have successive path items. (Changed results of several test cases, one test case added.) -

Re: SQL/JSON features for v15

2022-08-23 Thread Nikita Glukhov
On 23.08.2022 19:06, Pavel Stehule wrote: Hi út 23. 8. 2022 v 17:55 odesílatel Andres Freund napsal: Hi, On 2022-08-23 10:51:04 -0400, Robert Haas wrote: > I do not think that using subtransactions as part of the expression > evaluation process is a sound idea pretty much

  1   2   >