PostgreSQL two types of transaction isolation levels

Source: Internet
Author: User

PostgreSQL two types of transaction isolation levels:

Read Committed: The default isolation level in PostgreSQL. When a transaction runs at this isolation level, a select query can see only the data that was committed before the query was started and never see uncommitted data or changes made by other parallel transaction commits while the query was executing. If two transactions are being updated on the same tuple, the second update transaction waits for the first update transaction to commit or rollback. If the first update is rolled back, its effect is ignored, and the second update will continue to update the tuple that was originally discovered. If the first update commits, the system loves that recalculation of the query search criteria (WHERE clause), and if the tuple meets the criteria, the second update resumes its operation, starting with the updated version of the tuple.

Serializable: It provides the strictest transaction isolation. This level simulates a serial transaction execution, as if the transaction were executed sequentially (rather than in parallel). If two transactions are being updated on the same tuple, the serializable transaction waits for the first transaction being updated to commit or rollback. If the first update is rolled back, its impact is ignored, and the serializable transaction can complete its update operation on that tuple. But if the first update commits, the serializable transaction is rolled back and the entire transaction is re-started from the beginning.

PostgreSQL two types of transaction isolation levels

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.