pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Common SQL/JSON clauses
7+ messages / 4 participants
[nested] [flat]

* pgsql: Common SQL/JSON clauses
@ 2022-03-22 21:34  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 7+ messages in thread

From: Andrew Dunstan @ 2022-03-22 21:34 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Common SQL/JSON clauses

This introduces some of the building blocks used by the SQL/JSON
constructor and query functions. Specifically, it provides node
executor and grammar support for the FORMAT JSON [ENCODING foo]
clause, and values decorated with it, and for the RETURNING clause.

The following SQL/JSON patches will leverage these.

Nikita Glukhov (who probably deserves an award for perseverance).

Reviewers have included (in no particular order) Andres Freund, Alexander
Korotkov, Pavel Stehule, Andrew Alsup. Erik Rijkers, Zihong Yu and
Himanshu Upadhyaya.

Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/865fe4d5df560a6f5353da652018ff876978ad2d

Modified Files
--------------
src/backend/executor/execExpr.c      |  22 +++++
src/backend/nodes/copyfuncs.c        |  55 +++++++++++
src/backend/nodes/equalfuncs.c       |  39 ++++++++
src/backend/nodes/makefuncs.c        |  54 +++++++++++
src/backend/nodes/nodeFuncs.c        |  66 +++++++++++++
src/backend/nodes/outfuncs.c         |  39 ++++++++
src/backend/nodes/readfuncs.c        |  51 ++++++++++
src/backend/optimizer/util/clauses.c |  23 +++++
src/backend/parser/gram.y            |  65 ++++++++++++-
src/backend/parser/parse_expr.c      | 181 +++++++++++++++++++++++++++++++++++
src/backend/utils/adt/ruleutils.c    |  56 +++++++++++
src/backend/utils/misc/queryjumble.c |  26 +++++
src/include/nodes/makefuncs.h        |   5 +
src/include/nodes/nodes.h            |   4 +
src/include/nodes/parsenodes.h       |  13 +++
src/include/nodes/primnodes.h        |  59 ++++++++++++
src/include/parser/kwlist.h          |   2 +
17 files changed, 758 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Common SQL/JSON clauses
@ 2022-03-22 22:33  Andres Freund <andres@anarazel.de>
  parent: Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 7+ messages in thread

From: Andres Freund @ 2022-03-22 22:33 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-committers@lists.postgresql.org

Hi,

On 2022-03-22 21:34:25 +0000, Andrew Dunstan wrote:
> Common SQL/JSON clauses
> 
> This introduces some of the building blocks used by the SQL/JSON
> constructor and query functions. Specifically, it provides node
> executor and grammar support for the FORMAT JSON [ENCODING foo]
> clause, and values decorated with it, and for the RETURNING clause.
> 
> The following SQL/JSON patches will leverage these.

This currently triggers a number of warnings. I assume that's because of the
following patches not being there yet? How far out are those?

/home/andres/src/postgresql/src/backend/parser/gram.y: warning: 6 nonterminals useless in grammar [-Wother]
/home/andres/src/postgresql/src/backend/parser/gram.y: warning: 9 rules useless in grammar [-Wother]
/home/andres/src/postgresql/src/backend/parser/gram.y:15249.1-15: warning: nonterminal useless in grammar: json_value_expr [-Wother]
15249 | json_value_expr:
      | ^~~~~~~~~~~~~~~
/home/andres/src/postgresql/src/backend/parser/gram.y:15256.1-22: warning: nonterminal useless in grammar: json_format_clause_opt [-Wother]
15256 | json_format_clause_opt:
      | ^~~~~~~~~~~~~~~~~~~~~~
/home/andres/src/postgresql/src/backend/parser/gram.y:15268.1-19: warning: nonterminal useless in grammar: json_representation [-Wother]
15268 | json_representation:
      | ^~~~~~~~~~~~~~~~~~~
/home/andres/src/postgresql/src/backend/parser/gram.y:15276.1-24: warning: nonterminal useless in grammar: json_encoding_clause_opt [-Wother]
15276 | json_encoding_clause_opt:
      | ^~~~~~~~~~~~~~~~~~~~~~~~
/home/andres/src/postgresql/src/backend/parser/gram.y:15281.1-13: warning: nonterminal useless in grammar: json_encoding [-Wother]
15281 | json_encoding:
      | ^~~~~~~~~~~~~
/home/andres/src/postgresql/src/backend/parser/gram.y:15285.1-22: warning: nonterminal useless in grammar: json_output_clause_opt [-Wother]
15285 | json_output_clause_opt:
      | ^~~~~~~~~~~~~~~~~~~~~~


Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Common SQL/JSON clauses
@ 2022-03-22 23:21  Andrew Dunstan <andrew@dunslane.net>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 2 replies; 7+ messages in thread

From: Andrew Dunstan @ 2022-03-22 23:21 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-committers@lists.postgresql.org


On 3/22/22 18:33, Andres Freund wrote:
> Hi,
>
> On 2022-03-22 21:34:25 +0000, Andrew Dunstan wrote:
>> Common SQL/JSON clauses
>>
>> This introduces some of the building blocks used by the SQL/JSON
>> constructor and query functions. Specifically, it provides node
>> executor and grammar support for the FORMAT JSON [ENCODING foo]
>> clause, and values decorated with it, and for the RETURNING clause.
>>
>> The following SQL/JSON patches will leverage these.
> This currently triggers a number of warnings. I assume that's because of the
> following patches not being there yet? How far out are those?
>

Tomorrow, with the SQL/JSON constructors patch should resolve it. So
roughly 24 hours. It's not his fault but this happened because Alvaro
asked me to stagger the commits.


cheers


andrew



--
Andrew Dunstan
EDB: https://www.enterprisedb.com






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Common SQL/JSON clauses
@ 2022-03-23 00:08  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andrew Dunstan <andrew@dunslane.net>
  1 sibling, 1 reply; 7+ messages in thread

From: Tom Lane @ 2022-03-23 00:08 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: Andres Freund <andres@anarazel.de>; pgsql-committers@lists.postgresql.org

Andrew Dunstan <andrew@dunslane.net> writes:
> On 3/22/22 18:33, Andres Freund wrote:
>> This currently triggers a number of warnings. I assume that's because of the
>> following patches not being there yet? How far out are those?

> Tomorrow, with the SQL/JSON constructors patch should resolve it. So
> roughly 24 hours. It's not his fault but this happened because Alvaro
> asked me to stagger the commits.

Sounds like all you have to do is merge this commit with the next
one in the series?  Might as well do it if so.  But please don't
push something that generates warnings.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Common SQL/JSON clauses
@ 2022-03-23 09:47  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Andrew Dunstan <andrew@dunslane.net>
  1 sibling, 0 replies; 7+ messages in thread

From: Alvaro Herrera @ 2022-03-23 09:47 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: Andres Freund <andres@anarazel.de>; pgsql-committers@lists.postgresql.org

On 2022-Mar-22, Andrew Dunstan wrote:

> Tomorrow, with the SQL/JSON constructors patch should resolve it. So
> roughly 24 hours. It's not his fault but this happened because Alvaro
> asked me to stagger the commits.

Ouch, yeah.  This kind of problem can be observed by using something
like

git rebase -i origin/master -x "make install"

this will generate a rebase "todo list" that includes a "make install"
step after each individual commit, so you can verify that each commit is
warning-clean.

(By default there is no pause after each commit if there is a failure;
my strategy for dealing with that is to change each patch in the
rebase-todo-list from "pick" to "edit", so I can fix any problems, add
them to the commit, then continue the rebase.)

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"En las profundidades de nuestro inconsciente hay una obsesiva necesidad
de un universo lógico y coherente. Pero el universo real se halla siempre
un paso más allá de la lógica" (Irulan)





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: Common SQL/JSON clauses
@ 2022-03-23 11:39  Andrew Dunstan <andrew@dunslane.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Dunstan @ 2022-03-23 11:39 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andres Freund <andres@anarazel.de>; pgsql-committers@lists.postgresql.org


On 3/22/22 20:08, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> On 3/22/22 18:33, Andres Freund wrote:
>>> This currently triggers a number of warnings. I assume that's because of the
>>> following patches not being there yet? How far out are those?
>> Tomorrow, with the SQL/JSON constructors patch should resolve it. So
>> roughly 24 hours. It's not his fault but this happened because Alvaro
>> asked me to stagger the commits.
> Sounds like all you have to do is merge this commit with the next
> one in the series?  Might as well do it if so.  But please don't
> push something that generates warnings.
>
> 			



Yes, mea maxima culpa. I am working on a newer development machine than
the one I have used for years and I forgot to add check_warnings to the
test setup. That's remedied now.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Common SQL/JSON clauses
@ 2022-03-27 21:07  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Dunstan @ 2022-03-27 21:07 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Common SQL/JSON clauses

This introduces some of the building blocks used by the SQL/JSON
constructor and query functions. Specifically, it provides node
executor and grammar support for the FORMAT JSON [ENCODING foo]
clause, and values decorated with it, and for the RETURNING clause.

The following SQL/JSON patches will leverage these.

Nikita Glukhov (who probably deserves an award for perseverance).

Reviewers have included (in no particular order) Andres Freund, Alexander
Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zihong Yu,
Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby.

Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f79b803dcc98d707450e158db3638dc67ff8380b

Modified Files
--------------
src/backend/executor/execExpr.c      |  22 +++++
src/backend/nodes/copyfuncs.c        |  55 +++++++++++
src/backend/nodes/equalfuncs.c       |  39 ++++++++
src/backend/nodes/makefuncs.c        |  54 +++++++++++
src/backend/nodes/nodeFuncs.c        |  66 +++++++++++++
src/backend/nodes/outfuncs.c         |  39 ++++++++
src/backend/nodes/readfuncs.c        |  51 ++++++++++
src/backend/optimizer/util/clauses.c |  23 +++++
src/backend/parser/gram.y            |  65 ++++++++++++-
src/backend/parser/parse_expr.c      | 181 +++++++++++++++++++++++++++++++++++
src/backend/utils/adt/ruleutils.c    |  56 +++++++++++
src/backend/utils/misc/queryjumble.c |  26 +++++
src/include/nodes/makefuncs.h        |   5 +
src/include/nodes/nodes.h            |   4 +
src/include/nodes/parsenodes.h       |  13 +++
src/include/nodes/primnodes.h        |  59 ++++++++++++
src/include/parser/kwlist.h          |   2 +
17 files changed, 758 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2022-03-27 21:07 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22 21:34 pgsql: Common SQL/JSON clauses Andrew Dunstan <andrew@dunslane.net>
2022-03-22 22:33 ` Andres Freund <andres@anarazel.de>
2022-03-22 23:21   ` Andrew Dunstan <andrew@dunslane.net>
2022-03-23 00:08     ` Tom Lane <tgl@sss.pgh.pa.us>
2022-03-23 11:39       ` Andrew Dunstan <andrew@dunslane.net>
2022-03-23 09:47     ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-03-27 21:07 pgsql: Common SQL/JSON clauses Andrew Dunstan <andrew@dunslane.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox