Altering the SELECT portion of a CREATE TABLE AS plan

Поиск
Список
Период
Сортировка
От Jerry Sievert
Тема Altering the SELECT portion of a CREATE TABLE AS plan
Дата
Msg-id EC42A100-0ADA-4051-A0EC-DDB08AD597AB@legitimatesounding.com
обсуждение исходный текст
Список pgsql-hackers
Hi, i am trying to mutate a plan for a T_CreateTableAsStmt before it executes.

I've created a planner_hook_type hook, where i can see the plan that gets executed as part of the AS of the query,
wherethe CmdType is CMD_SELECT, and its subplans are the plans for the actual select itself. 

I've also created a ProcessUtility_hook_type, which correctly shows the T_CreateTableAsStmt, but the hook is called
afterthe actual CREATE TABLE is called, and the plan is no longer mutable for the part that i need. 

Is there another hook i should be looking at, or another way i should be approaching this?  I need to be able to alter
theplan specifically for the SELECT portion of a CREATE TABLE AS query, but only in the case of the SELECT TABLE AS,
andin no other SELECTs. 

Alternately, I can look at the query string in the CMD_SELECT planner hook and search specifically for CREATE, TABLE
andAS, but I feel that there has to be a better way, and look forward to some guidance. 

Thanks!


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

Предыдущее
От: Chapman Flack
Дата:
Сообщение: Re: PostgreSQL 16 release announcement draft
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: pg_stat_get_backend_subxact() and backend IDs?