DELETE

An SQL command for deleting rows

DELETE is a DML command for deleting one or more rows.

DELETE has always been present in PostgreSQL.

Change history

Examples

Basic usage example for DELETE:

postgres=# DELETE FROM foo;
DELETE 1

Using DELETE with RETURNING:

postgres=# DELETE FROM foo RETURNING *;
 id |              val              
----+-------------------------------
  1 | 2020-11-27 08:32:17.741344+01
(1 row)

DELETE 1
  • PostgreSQL documentation: DELETE

Categories

DML, SQL command

See also

TRUNCATE