START_TRANSACTION(7)

โœจ 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: the DEFERRABLE transaction_mode is 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 ๐Ÿ‘‘


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 ๐ŸŽ€๐Ÿฆ‹๐Ÿ’