开发者

Is TRUNCATE a DML statement?

开发者 https://www.devze.com 2023-01-13 09:28 出处:网络
Can we classify/say that TRUNCATE belongs to/falls under DML statement? Check here for PostgreSQL TRUNCATE compatibility.

Can we classify/say that TRUNCATE belongs to/falls under DML statement?

Check here for PostgreSQL TRUNCATE compatibility.

开发者_JAVA百科NOTE: TRUNCATE is part of SQL standard ANSI SQL 2008 - F200


PostgreSQL

I would say it's a DML statement in PostgreSQL: PostgreSQL has a TRUNCATE trigger but PostgreSQL doesn't have DDL triggers. So it can't be a DDL statement.

It acquires an ACCESS EXCLUSIVE lock on each table it operates on and it's not MVCC-safe but it's transactionsafe and you can do a rollback.

The ability to fire triggers for TRUNCATE is a PostgreSQL extension of the SQL standard.


As TRUNCATE manipulates data and does not change any definition, I clearly see it as a DML statement.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号