START_TRANSACTION(7pg18)
โจ START_TRANSACTION โจ
okay bestie, welcome to the START TRANSACTION(7) page from the PostgreSQL 18.6 docs ๐ this is the manual page for START_TRANSACTION, and it's genuinely so simple you're gonna be like "wait that's it?" ๐
๐ธ NAME ๐ธ
START_TRANSACTION โ start a transaction block. that's the whole vibe. it opens a block, that's its job, it's giving gatekeeper of the transaction ๐ฅ
๐ฆ 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
like. look at those options. gorgeous. each one is a little personality trait you can give your brand new transaction ๐
๐ DESCRIPTION ๐
so this command begins a new transaction block. that's it, that's the main character move โจ
and if you specify the isolation level, the read/write mode, or the deferrable mode, then your new transaction literally gets those characteristics โ exactly as if you'd run SET TRANSACTION. same energy, same result, no cap ๐ซถ
also: this is the same as the BEGIN command. literally twins. identical. BEGIN walked so START TRANSACTION could run, iykyk ๐
๐ PARAMETERS ๐
ngl bestie, this page is not gonna explain the parameters to you. it's like "go read SET TRANSACTION" (SET_TRANSACTION(7)) for info on what the parameters to this statement actually mean ๐
so if you're confused about SERIALIZABLE vs REPEATABLE READ vs whatever, that's a different page, go drink your water and click that link ๐
๐ COMPATIBILITY ๐
okay this is where it gets interesting ๐
in the standard, you don't even need to issue START TRANSACTION to start a transaction block โ because any SQL command implicitly begins a block. every single one. iconic behaviour, honestly.
so how does PostgreSQL fit into that? PostgreSQL's behaviour can be seen as implicitly issuing a COMMIT after each command that does not follow START TRANSACTION (or BEGIN) โ and because of that, people often call it "autocommit" โญ
other relational database systems might offer an autocommit feature as a convenience. cute for them ๐
heads up: theDEFERRABLEtransaction_modeis a PostgreSQL language extension โ so don't go expecting it everywhere else, bestie ๐จ
also: the SQL standard requires commas between successive transaction_modes, but for historical reasons PostgreSQL allows the commas to be omitted. yes really. she's flexible like that ๐ธ
and there's more tea โ see also the compatibility section of SET TRANSACTION (SET_TRANSACTION(7)) ๐
๐ SEE ALSO ๐
BEGIN(7)COMMIT(7)ROLLBACK(7)SAVEPOINT(7)SET TRANSACTION(SET_TRANSACTION(7))
that's the whole page bestie, go start a transaction, you're gonna slay ๐โจ
PostgreSQL 18.6 ยท 2026 โ mwah, that's a wrap on START TRANSACTION(7), thanks for coming to my TED talk ๐๐ฆ๐
๐ฆ where this page comes from
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms