Re: Identifying ALTER TABLE "sub-command" - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Identifying ALTER TABLE "sub-command"
Date
Msg-id 20180111162522.fbfwt5v5hr3b6s4v@alvherre.pgsql
Whole thread Raw
In response to Identifying ALTER TABLE "sub-command"  (Jeremy Finzel <finzelj@gmail.com>)
List 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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: numeric regression test passes, but why?
Next
From: Chapman Flack
Date:
Subject: Re: numeric regression test passes, but why?