Re: Identifying ALTER TABLE "sub-command"

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: Jeremy Finzel <finzelj(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Identifying ALTER TABLE "sub-command"
Date: 2018-01-11 16:19:41
Message-ID: 431381515687581@web10g.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<div>Hello</div><div>You can start with functions ATPrepCmd and ATExecCmd in src/backend/commands/tablecmds.c</div><div>Also note, one alter table statement can have multiple different actions.</div><div> </div><div>Regards, Sergei</div><div><br /></div><div><br /></div><div>11.01.2018, 18:56, "Jeremy Finzel" &lt;finzelj(at)gmail(dot)com&gt;:</div><blockquote type="cite"><div dir="ltr">Hello -<div><br /></div><div>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 <span style="color:rgb(0,0,0);font-family:Menlo;font-size:9pt;">CreateCommandTag(parsetree)</span>.  However, is there a way (or a starting point) to identify the sub-command as well i.e. ENABLE TRIGGER, ADD FOREIGN KEY, etc.?</div><div><br /></div><div>Any direction is much appreciated.</div><div><br /></div><div>Thanks,</div><div>Jeremy</div></div>
</blockquote>

Attachment Content-Type Size
unknown_filename text/html 924 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ildar Musin 2018-01-11 16:21:46 Re: General purpose hashing func in pgbench
Previous Message Chapman Flack 2018-01-11 16:16:29 Re: numeric regression test passes, but why?