Loading topic
SELECT, INSERT, UPDATE, DELETE), what a primary key and a CHECK constraint are, and the basic BEGIN, COMMIT and ROLLBACK commands from the previous chapter. The examples use PostgreSQL syntax. Where other systems behave differently, the text s7 min readBEGIN, COMMIT and ROLLBACK work, and that a database serves many sessions at once. Examples use PostgreSQL syntax. Other databases follow the same ideas but differ in details.6 min readBEGIN, COMMIT and ROLLBACK, and that you know a failed statement inside a transaction is an error you must handle. The examples use PostgreSQL syntax. The last section notes where other databases differ.5 min readSELECT ... FOR UPDATE. The examples use PostgreSQL syntax. The ideas apply to MySQL/InnoDB and SQL Server too, though error codes and defaults differ.6 min readSELECT ... FOR UPDATE, and how a deadlock arises. Examples use PostgreSQL and Python with the psycopg driver (version 3). The ideas carry over to other databases and drivers, but error codes diffe6 min read