Skip to content
masterclass Buddy

PostgreSQL · Command

DELETE

DELETE removes rows that match a condition from a PostgreSQL table. Without WHERE, it removes every row in the table.

Last updated

Syntax

[ WITH [ RECURSIVE ] with_query [, ...] ] DELETE FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ] [ USING from_item [, ...] ] [ WHERE condition | WHERE CURRENT OF cursor_name ] [ RETURNING [ WITH ( { OLD | NEW } AS output_alias [, ...] ) ] { * | output_expression [ [ AS ] output_name ] } [, ...] ]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • TRUNCATE
  • UPDATE
  • SELECT
  • USING
  • RETURNING
  • WHERE CURRENT OF
  • WITH

Source: PostgreSQL: Documentation: 18: DELETE. Checked 2026-11-03.