Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit367c989

Browse files
committed
Remove custom _jumbleRangeTblEntry()
This is part of an effort to reduce the number of special cases in theautomatically generated node support functions.This patch removes _jumbleRangeTblEntry() and instead adds per-fieldquery_jumble_ignore annotations to match the behavior of the previouscustom code. The pg_stat_statements test suite has some coverage ofthis. It gets rid of the switch on rtekind; this should betechnically correct, since we do the equal and copy functions likethis also.The list of fields to jumble has been checked and is consideredcorrect as of8b29a11.Reviewed-by: Andrew Dunstan <andrew@dunslane.net>Discussion:https://www.postgresql.org/message-id/flat/4b27fc50-8cd6-46f5-ab20-88dbaadca645@eisentraut.org
1 parentd575051 commit367c989

File tree

2 files changed

+20
-69
lines changed

2 files changed

+20
-69
lines changed

‎src/backend/nodes/queryjumblefuncs.c

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -353,52 +353,3 @@ _jumbleA_Const(JumbleState *jstate, Node *node)
353353
}
354354
}
355355
}
356-
357-
staticvoid
358-
_jumbleRangeTblEntry(JumbleState*jstate,Node*node)
359-
{
360-
RangeTblEntry*expr= (RangeTblEntry*)node;
361-
362-
JUMBLE_FIELD(rtekind);
363-
switch (expr->rtekind)
364-
{
365-
caseRTE_RELATION:
366-
JUMBLE_FIELD(relid);
367-
JUMBLE_FIELD(inh);
368-
JUMBLE_NODE(tablesample);
369-
break;
370-
caseRTE_SUBQUERY:
371-
JUMBLE_NODE(subquery);
372-
break;
373-
caseRTE_JOIN:
374-
JUMBLE_FIELD(jointype);
375-
break;
376-
caseRTE_FUNCTION:
377-
JUMBLE_NODE(functions);
378-
JUMBLE_FIELD(funcordinality);
379-
break;
380-
caseRTE_TABLEFUNC:
381-
JUMBLE_NODE(tablefunc);
382-
break;
383-
caseRTE_VALUES:
384-
JUMBLE_NODE(values_lists);
385-
break;
386-
caseRTE_CTE:
387-
388-
/*
389-
* Depending on the CTE name here isn't ideal, but it's the only
390-
* info we have to identify the referenced WITH item.
391-
*/
392-
JUMBLE_STRING(ctename);
393-
JUMBLE_FIELD(ctelevelsup);
394-
break;
395-
caseRTE_NAMEDTUPLESTORE:
396-
JUMBLE_STRING(enrname);
397-
break;
398-
caseRTE_RESULT:
399-
break;
400-
default:
401-
elog(ERROR,"unrecognized RTE kind: %d", (int)expr->rtekind);
402-
break;
403-
}
404-
}

‎src/include/nodes/parsenodes.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ typedef enum RTEKind
10231023

10241024
typedefstructRangeTblEntry
10251025
{
1026-
pg_node_attr(custom_read_write,custom_query_jumble)
1026+
pg_node_attr(custom_read_write)
10271027

10281028
NodeTagtype;
10291029

@@ -1072,11 +1072,11 @@ typedef struct RangeTblEntry
10721072
/* inheritance requested? */
10731073
boolinh;
10741074
/* relation kind (see pg_class.relkind) */
1075-
charrelkind;
1075+
charrelkindpg_node_attr(query_jumble_ignore);
10761076
/* lock level that query requires on the rel */
1077-
intrellockmode;
1077+
intrellockmodepg_node_attr(query_jumble_ignore);
10781078
/* index of RTEPermissionInfo entry, or 0 */
1079-
Indexperminfoindex;
1079+
Indexperminfoindexpg_node_attr(query_jumble_ignore);
10801080
/* sampling info, or NULL */
10811081
structTableSampleClause*tablesample;
10821082

@@ -1086,7 +1086,7 @@ typedef struct RangeTblEntry
10861086
/* the sub-query */
10871087
Query*subquery;
10881088
/* is from security_barrier view? */
1089-
boolsecurity_barrier;
1089+
boolsecurity_barrierpg_node_attr(query_jumble_ignore);
10901090

10911091
/*
10921092
* Fields valid for a join RTE (else NULL/zero):
@@ -1133,20 +1133,20 @@ typedef struct RangeTblEntry
11331133
*/
11341134
JoinTypejointype;
11351135
/* number of merged (JOIN USING) columns */
1136-
intjoinmergedcols;
1136+
intjoinmergedcolspg_node_attr(query_jumble_ignore);
11371137
/* list of alias-var expansions */
1138-
List*joinaliasvars;
1138+
List*joinaliasvarspg_node_attr(query_jumble_ignore);
11391139
/* left-side input column numbers */
1140-
List*joinleftcols;
1140+
List*joinleftcolspg_node_attr(query_jumble_ignore);
11411141
/* right-side input column numbers */
1142-
List*joinrightcols;
1142+
List*joinrightcolspg_node_attr(query_jumble_ignore);
11431143

11441144
/*
11451145
* join_using_alias is an alias clause attached directly to JOIN/USING. It
11461146
* is different from the alias field (below) in that it does not hide the
11471147
* range variables of the tables being joined.
11481148
*/
1149-
Alias*join_using_alias;
1149+
Alias*join_using_aliaspg_node_attr(query_jumble_ignore);
11501150

11511151
/*
11521152
* Fields valid for a function RTE (else NIL/zero):
@@ -1180,7 +1180,7 @@ typedef struct RangeTblEntry
11801180
/* number of query levels up */
11811181
Indexctelevelsup;
11821182
/* is this a recursive self-reference? */
1183-
boolself_reference;
1183+
boolself_referencepg_node_attr(query_jumble_ignore);
11841184

11851185
/*
11861186
* Fields valid for CTE, VALUES, ENR, and TableFunc RTEs (else NIL):
@@ -1201,33 +1201,33 @@ typedef struct RangeTblEntry
12011201
* for zero coltype is the standard way to detect a dropped column.
12021202
*/
12031203
/* OID list of column type OIDs */
1204-
List*coltypes;
1204+
List*coltypespg_node_attr(query_jumble_ignore);
12051205
/* integer list of column typmods */
1206-
List*coltypmods;
1206+
List*coltypmodspg_node_attr(query_jumble_ignore);
12071207
/* OID list of column collation OIDs */
1208-
List*colcollations;
1208+
List*colcollationspg_node_attr(query_jumble_ignore);
12091209

12101210
/*
12111211
* Fields valid for ENR RTEs (else NULL/zero):
12121212
*/
12131213
/* name of ephemeral named relation */
12141214
char*enrname;
12151215
/* estimated or actual from caller */
1216-
Cardinalityenrtuples;
1216+
Cardinalityenrtuplespg_node_attr(query_jumble_ignore);
12171217

12181218
/*
12191219
* Fields valid in all RTEs:
12201220
*/
12211221
/* user-written alias clause, if any */
1222-
Alias*alias;
1222+
Alias*aliaspg_node_attr(query_jumble_ignore);
12231223
/* expanded reference names */
1224-
Alias*eref;
1224+
Alias*erefpg_node_attr(query_jumble_ignore);
12251225
/* was LATERAL specified? */
1226-
boollateral;
1226+
boollateralpg_node_attr(query_jumble_ignore);
12271227
/* present in FROM clause? */
1228-
boolinFromCl;
1228+
boolinFromClpg_node_attr(query_jumble_ignore);
12291229
/* security barrier quals to apply, if any */
1230-
List*securityQuals;
1230+
List*securityQualspg_node_attr(query_jumble_ignore);
12311231
}RangeTblEntry;
12321232

12331233
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp