aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-12-02 18:05:29 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2019-12-02 18:05:29 -0500
commitce76c0ba53e4bd0daf3db7a703671b27797b7244 (patch)
tree920ca4a5cc36e169181e12cc3880f2295f28e17a /src/backend/nodes/copyfuncs.c
parent4526951d564a7eed512b4a0ac3b5893e0a115690 (diff)
downloadpostgresql-ce76c0ba53e4bd0daf3db7a703671b27797b7244.tar.gz
postgresql-ce76c0ba53e4bd0daf3db7a703671b27797b7244.zip
Add a reverse-translation column number array to struct AppendRelInfo.
This provides for cheaper mapping of child columns back to parent columns. The one existing use-case in examine_simple_variable() would hardly justify this by itself; but an upcoming bug fix will make use of this array in a mainstream code path, and it seems likely that we'll find other uses for it as we continue to build out the partitioning infrastructure. Discussion: https://postgr.es/m/12424.1575168015@sss.pgh.pa.us
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 2f267e4bb65..a74b56bb599 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -2327,6 +2327,8 @@ _copyAppendRelInfo(const AppendRelInfo *from)
COPY_SCALAR_FIELD(parent_reltype);
COPY_SCALAR_FIELD(child_reltype);
COPY_NODE_FIELD(translated_vars);
+ COPY_SCALAR_FIELD(num_child_cols);
+ COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
COPY_SCALAR_FIELD(parent_reloid);
return newnode;