START_TRANSACTION(7pg13)
β¨ START_TRANSACTION(7pg13) β¨
okay so real quick β this is from the PostgreSQL 13.23 Documentation, manual page START TRANSACTION(7), and bestie you are gonna get transactions after this, i promise π«Ά
π NAME π
START_TRANSACTION β start a transaction block
like, open a whole new little world of work that hasn't been committed yet. main character energy fr π
πΈ SYNOPSIS πΈ
START TRANSACTION [ transaction_mode [, ...] ]
where transaction_mode is one of:
ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED }
READ WRITE | READ ONLY
[ NOT ] DEFERRABLE
look at her go π every one of those modes is listed, no cap, nothing skipped.
π DESCRIPTION π
This command begins a new transaction block. That's the whole vibe β you're starting something, and it's a block.
If you specify the isolation level, the read/write mode, or the deferrable mode, then the new transaction has exactly those characteristics β it's literally as if SET TRANSACTION (SET_TRANSACTION(7)) was executed. same energy, different entrance.
And yes, this is the same as the BEGIN(7) command. they're twins. π―ββοΈ START TRANSACTION is just the one who read the SQL standard.
ngl this is the "start as you mean to go" of SQL. if you don't say the modes here, you can still set them later β but like, why not say it upfront? πββοΈ
π¦ PARAMETERS π¦
okay so this section is short and honestly kind of a "go read the other page" moment:
Refer to SET TRANSACTION (SET_TRANSACTION(7)) for information on the meaning of the parameters to this statement. that's it. that's the paragraph. she's pointing you to her more detailed bestie π«Ά
β COMPATIBILITY β
so in the standard, you don't have to issue START TRANSACTION to start a transaction block at all β any SQL command implicitly begins a block. iconic of them honestly.
PostgreSQL's behavior can be seen as implicitly issuing a COMMIT after each command that does not follow START TRANSACTION (or BEGIN), and it is therefore often called βautocommitβ. Other relational database systems might offer an autocommit feature as a convenience. cute for them π
The DEFERRABLE transaction_mode is a PostgreSQL language extension β i.e. not part of the standard, she's built different π§
The SQL standard requires commas between successive transaction_modes, but for historical reasons PostgreSQL allows the commas to be omitted. (yes that's right, you can rawdog it with no commas. history said so. π)
Also: see the compatibility section of SET TRANSACTION (SET_TRANSACTION(7)). go read that one too, she's thorough.
π SEE ALSO π
BEGIN(7)COMMIT(7)ROLLBACK(7)SAVEPOINT(7)SET TRANSACTION(SET_TRANSACTION(7))
the whole friend group πβ¨
PostgreSQL 13.23 Β· 2025 Β· START TRANSACTION(7) β mwah, that's the page, go start a transaction bestie, love u, bye ππ¦πΈπ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms