Re: Should TRUNCATE fire DDL triggers - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Should TRUNCATE fire DDL triggers
Date
Msg-id CAKFQuwYH4ndD3jJvaHEqE6apSD=nS+TumopF1a8VoaFCmZDJWg@mail.gmail.com
Whole thread Raw
In response to Should TRUNCATE fire DDL triggers  (Hari Krishna Sunder <hari.db.pg@gmail.com>)
Responses Re: Should TRUNCATE fire DDL triggers
List pgsql-hackers
On Tuesday, July 8, 2025, Hari Krishna Sunder <hari.db.pg@gmail.com> wrote:
First of all, is TRUNCATE a DDL or a DML? This doc refers to it as a DDL, whereas other docs like this and this treat it as a DML, so which one is it?

Neither…classification systems are often imperfect…but it sure quacks like DML to my ears.  I’d probably remove the term “DDL” from that first link and avoid the grey area.  Listing the two commands suffices.
 

A lot of other SQL databases treat TRUNCATE as a DDL, so assuming that is true, can we add it to the command tags supported by "ddl_command_start" and "ddl_command_end" triggers?


Seems worthy of consideration regardless of how one answers the prior question; for much the same reason.

David J.

pgsql-hackers by date:

Previous
From: Hari Krishna Sunder
Date:
Subject: Should TRUNCATE fire DDL triggers
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] Add support for displaying database service in psql prompt