---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/postgresql/statements/delete_from.md?version=v25.3
  - https://ydb.tech/docs/ru/postgresql/statements/delete_from.md?version=v25.3
  - href: en/postgresql/statements/delete_from.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/core/postgresql/statements/delete_from.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# DELETE FROM

<!-- markdownlint-disable blanks-around-fences -->

<!-- source: en/postgresql/_includes/alert_preview.md -->
{% note warning %}

At the moment, YDB's compatibility with PostgreSQL **is under development**, so not all PostgreSQL constructs and [functions](https://ydb.tech/docs/en/postgresql/functions.md?version=v25.3) are supported yet. PostgreSQL compatibility is available for testing in the form of a Docker container, which can be deployed by following these [instructions](https://ydb.tech/docs/en/postgresql/docker-connect.md?version=v25.3).

{% endnote %}
<!-- endsource: en/postgresql/_includes/alert_preview.md -->

Syntax of the `DELETE FROM` statement:

<!-- source: en/postgresql/_includes/statements/delete_from/syntax.md -->
 ```sql
 DELETE FROM <table name>
 WHERE <column name><condition><value/range>;
 ```
<!-- endsource: en/postgresql/_includes/statements/delete_from/syntax.md -->

To delete a row from a table based on a specific column value, the construction `DELETE FROM <table name> WHERE <column name><condition><value/range>` is used.

{% note warning %}

Note that the use of the `WHERE ...` clause is optional, so when working with `DELETE FROM` it is very important to avoid accidentally executing the command before specifying the `WHERE ...` clause.

{% endnote %}

<!-- source: en/postgresql/_includes/alert_locks.md -->
{% note info %}

Unlike PostgreSQL, YDB uses optimistic locking. This means that transactions check the conditions for the necessary locks at the end of their operation, not at the beginning. If the lock has been violated during the transaction's execution, such a transaction will end with a `Transaction locks invalidated` error. In this case, you can try to execute a similar transaction again.

{% endnote %}
<!-- endsource: en/postgresql/_includes/alert_locks.md -->