Maintained with ☕️ by
IcePanel logo

Spanner supports the SELECT…FOR UPDATE query syntax in GoogleSQL and PostgreSQL-dialect databases

Share

Services

## Feature Spanner supports the `SELECT…FOR UPDATE` query syntax in GoogleSQL and PostgreSQL-dialect databases. When you use the `SELECT` query to scan a table, add a `FOR UPDATE` clause to enable exclusive locks on the scanned data in order to reduce aborts for workloads that operate on the same data concurrently. This is similar to the `LOCK_SCANNED_RANGES` hint ([GoogleSQL](https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#statement%5Fhints) and [PostgreSQL](https://cloud.google.com/spanner/docs/reference/postgresql/query-syntax#statement-hints)). For more information, see [Use SELECT… FOR UPDATE](https://cloud.google.com/spanner/docs/use-select-for-update).