Re: SQL/JSON: JSON_TABLE - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: SQL/JSON: JSON_TABLE
Date
Msg-id CAFj8pRCxyZgTSJWoxaKiDUc-BKYgKmzsAMXF2QeKv-dpB6pyrw@mail.gmail.com
Whole thread Raw
In response to Re: SQL/JSON: JSON_TABLE  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
Responses Re: SQL/JSON: JSON_TABLE  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
List pgsql-hackers
Hi

út 16. 7. 2019 v 16:06 odesílatel Nikita Glukhov <n.gluhov@postgrespro.ru> napsal:

On 29.06.2019 8:40, Pavel Stehule wrote:

Hi

so 29. 6. 2019 v 7:26 odesílatel Nikita Glukhov <n.gluhov@postgrespro.ru> napsal:
Attached 36th version of patches rebased onto jsonpath v36.

I cannot to apply these patches on master. Please, can you check these patches?


Attached 37th version of patches rebased onto current master.

I got warning

ar crs libpgcommon.a base64.o config_info.o controldata_utils.o d2s.o exec.o f2s.o file_perm.o ip.o keywords.o kwlookup.o link-canary.o md5.o pg_lzcompress.o pgfnames.o psprintf.o relpath.o rmtree.o saslprep.o scram-common.o string.o unicode_norm.o username.o wait_error.>
...skipping...
clauses.c:1076:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
 1076 |   if (ExecEvalJsonNeedsSubTransaction(jsexpr, NULL))
      |   ^~
clauses.c:1078:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
 1078 |    return true;
      |    ^~~~~~
gcc -Wall -Wmissing-protot

Regress tests diff is not empty - see attached file

some strange fragments from code:

    deparseExpr(node->arg, context);
-   if (node->relabelformat != COERCE_IMPLICIT_CAST)
+   if (node->relabelformat != COERCE_IMPLICIT_CAST &&
+       node->relabelformat == COERCE_INTERNAL_CAST)


Now, "format"  is type_func_name_keyword, so when you use it, then nobody can use "format" as column name. It can break lot of application. "format" is common name. It is relatively unhappy, and it can touch lot of users.

This patch set (JSON functions & JSON_TABLE) has more tha 20K rows. More, there are more than few features are implemented.

Is possible to better (deeper) isolate these features, please? I have nothing against any implemented feature, but it is hard to work intensively (hard test) on this large patch. JSON_TABLE has only 184kB, can we start with this patch?

SQLJSON_FUNCTIONS has 760kB - it is maybe too much for one feature, one patch.


Pavel



--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Support for jsonpath .datetime() method
Next
From: Amit Khandekar
Date:
Subject: Re: POC: Cleaning up orphaned files using undo logs