FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
The Complete Guide to PostgreSQL Lock Types for Schema Changes
How-ToSystems

The Complete Guide to PostgreSQL Lock Types for Schema Changes

via Dev.toMickel Samuel14h ago

If you run DDL against a production PostgreSQL database without understanding locks, you will cause an outage. That is not a maybe. This guide covers every lock level, which statements acquire which locks, and what that means for your running application. PostgreSQL Lock Levels: The Full Hierarchy PostgreSQL has eight table-level lock modes, ordered from least restrictive to most restrictive. Two locks conflict when one would violate the guarantees of the other. Understanding this hierarchy is the foundation of safe schema changes. Lock Level Blocks Reads? Blocks Writes? Acquired By ACCESS SHARE No No SELECT ROW SHARE No No SELECT FOR UPDATE/SHARE ROW EXCLUSIVE No No INSERT, UPDATE, DELETE SHARE UPDATE EXCLUSIVE No No VACUUM, CREATE INDEX CONCURRENTLY, ALTER TABLE (some) SHARE No Yes CREATE INDEX (without CONCURRENTLY) SHARE ROW EXCLUSIVE No Yes CREATE TRIGGER, some ALTER TABLE EXCLUSIVE No Yes REFRESH MATERIALIZED VIEW CONCURRENTLY ACCESS EXCLUSIVE Yes Yes DROP, TRUNCATE, most ALTER T

Continue reading on Dev.to

Opens in a new tab

Read Full Article
0 views

Related Articles

How To Make Style Statements …
How-To

How To Make Style Statements …

Medium Programming • 7h ago

The 3 Biggest Mistakes Founders Make When Expanding to Europe (And How to Avoid Legal Fees).
How-To

The 3 Biggest Mistakes Founders Make When Expanding to Europe (And How to Avoid Legal Fees).

Medium Programming • 7h ago

The Math Behind the Match: Building Production Search for People Names
How-To

The Math Behind the Match: Building Production Search for People Names

Hackernoon • 8h ago

How-To

Title: How to Mine Real Crypto on Your Phone — No Equipment, No Investment, Just a Game

Medium Programming • 8h ago

7 Coding Habits That Will Improve Your Skills
How-To

7 Coding Habits That Will Improve Your Skills

Medium Programming • 11h ago

Discover More Articles