1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Code review for recent SQL/JSON commits

- At the last minute and for no particularly good reason, I changed the
  WITHOUT token to be marked especially for lookahead, from the one in
  WITHOUT TIME to the one in WITHOUT UNIQUE.  Study of upcoming patches
  (where a new WITHOUT ARRAY WRAPPER clause is added) showed me that the
  former was better, so put it back the way the original patch had it.

- update exprTypmod() for JsonConstructorExpr to return the typmod of
  the RETURNING clause, as a comment there suggested.  Perhaps it's
  possible for this to make a difference with datetime types, but I
  didn't try to build a test case.

- The nodeFuncs.c support code for new nodes was calling walker()
  directly instead of the WALK() macro as introduced by commit 1c27d16e6e.
  Modernize that.  Also add exprLocation() support for a couple of nodes
  that missed it.  Lastly, reorder the code more sensibly.

The WITHOUT_LA -> WITHOUT change means that stored rules containing
either WITHOUT TIME ZONE or WITHOUT UNIQUE KEYS would change
representation.  Therefore, bump catversion.

Discussion: https://postgr.es/m/20230329181708.e64g2tpy7jyufqkr@alvherre.pgsql
This commit is contained in:
Alvaro Herrera
2023-04-04 14:04:30 +02:00
parent 8a2b1b1477
commit 71bfd1543f
5 changed files with 266 additions and 172 deletions

View File

@ -159,10 +159,10 @@ filtered_base_yylex(void)
break;
case WITHOUT:
/* Replace WITHOUT by WITHOUT_LA if it's followed by UNIQUE */
/* Replace WITHOUT by WITHOUT_LA if it's followed by TIME */
switch (next_token)
{
case UNIQUE:
case TIME:
cur_token = WITHOUT_LA;
break;
}