COPY planning

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема COPY planning
Дата
Msg-id 20150921191602.GE88970@alvherre.pgsql
обсуждение исходный текст
Ответы Re: COPY planning  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I noticed that COPY calls planner() (this was introduced in 85188ab88).
I think it should be calling pg_plan_query() instead.  The latter is a
very thin wrapper around the former which simply adds a couple of
logging entries, DTrace hooks for start/end, and a debugging cross-check
for plan node copying.

I came across this because I was considering adding some code to
pg_plan_query, so I would have needed to essentially duplicate it in the
COPY path, which seemed bad.  (I have since abandoned the idea, but this
seems a reasonable thing to change nonetheless.)


diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index e98f0fe..94b2f8f 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -1414,7 +1414,7 @@ BeginCopy(bool is_from,        Assert(query->utilityStmt == NULL);        /* plan the query */
-        plan = planner(query, 0, NULL);
+        plan = pg_plan_query(query, 0, NULL);        /*         * With row level security and a user using "COPY
relationTO", we
 

-- 
Álvaro Herrera                            33.5S 70.5W



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: COMPARE_POINTER_FIELD been dead 13 years after living 2 weeks
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: LW_SHARED_MASK macro