Re: Identifying ALTER TABLE "sub-command"

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Identifying ALTER TABLE "sub-command"
Дата
Msg-id 20180111162522.fbfwt5v5hr3b6s4v@alvherre.pgsql
обсуждение исходный текст
Ответ на Identifying ALTER TABLE "sub-command"  (Jeremy Finzel <finzelj@gmail.com>)
Список pgsql-hackers
Jeremy Finzel wrote:
> Hello -
> 
> I have found that in leveraging the parser code to decode DDL SQL, it is
> very easy to get which type of general command is being issued with
> CreateCommandTag(parsetree).  However, is there a way (or a starting point)
> to identify the sub-command as well i.e. ENABLE TRIGGER, ADD FOREIGN KEY,
> etc.?

Hi Jeremy,

See the test code in src/test/modules/test_ddl_deparse/test_ddl_deparse.c
It might give you some ideas.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: numeric regression test passes, but why?
Следующее
От: Chapman Flack
Дата:
Сообщение: Re: numeric regression test passes, but why?