<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/all-your-gucs-in-a-row-deadlock-timeout-3g1yv7vql" -->

---
title: All Your GUCs in a Row: deadlock_timeout | daily.dev
description: PostgreSQL&#x27;s `deadlock_timeout` parameter is commonly misunderstood: it doesn&#x27;t control how long a deadlock is tolerated, but rather how long a process waits...
canonical: https://daily.dev/posts/all-your-gucs-in-a-row-deadlock-timeout-3g1yv7vql
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: All Your GUCs in a Row: deadlock_timeout | daily.dev
og:description: PostgreSQL&#x27;s `deadlock_timeout` parameter is commonly misunderstood: it doesn&#x27;t control how long a deadlock is tolerated, but rather how long a process waits...
og:url: https://daily.dev/posts/all-your-gucs-in-a-row-deadlock-timeout-3g1yv7vql
og:image: https://api.daily.dev/og/posts/3g1yv7vql.png
og:image:alt: All Your GUCs in a Row: deadlock_timeout
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# All Your GUCs in a Row: deadlock_timeout

**[Planet PostgreSQL](https://daily.dev/sources/planet-postgresql)** · 4 min read · 0 upvotes · 0 comments

## Summary

PostgreSQL's `deadlock_timeout` parameter is commonly misunderstood: it doesn't control how long a deadlock is tolerated, but rather how long a process waits on a lock before PostgreSQL runs its deadlock detection algorithm. Detection is deferred because building and searching a wait-for-graph is expensive, and most lock waits resolve before the timer fires. When detection does run, it distinguishes between hard edges (actual lock holds) and soft edges (queue position), and can sometimes resolve cycles by reordering the wait queue rather than aborting a transaction. The default of 1s is appropriate for most workloads. A practical diagnostic trick: pair a lowered `deadlock_timeout` (e.g., 100ms) with `log_lock_waits = on` to surface lock contention that never escalates to a full deadlock error.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://postgr.es/p/9lC>

## Similar posts on daily.dev

- [All Your GUCs in a Row: lock\_timeout](https://daily.dev/posts/all-your-gucs-in-a-row-lock-timeout-lgkvtjo67) · Planet PostgreSQL · 2 upvotes · 1 comments
- [All Your GUCs in a Row: idle\_in\_transaction\_session\_timeout](https://daily.dev/posts/all-your-gucs-in-a-row-idle-in-transaction-session-timeout-uzk5lzuwc) · Planet PostgreSQL · 1 upvotes · 0 comments
- [All Your GUCs in a Row: log\_lock\_waits and log\_lock\_failures](https://daily.dev/posts/all-your-gucs-in-a-row-log-lock-waits-and-log-lock-failures-9m15stxgx) · Planet PostgreSQL · 1 upvotes · 1 comments
- [All Your GUCs in a Row: idle\_session\_timeout](https://daily.dev/posts/all-your-gucs-in-a-row-idle-session-timeout-m83cxdjmg) · Planet PostgreSQL · 0 upvotes · 0 comments
- [How to Fix Postgres ERROR: deadlock detected](https://daily.dev/posts/how-to-fix-postgres-error-deadlock-detected-s28daquxh) · Medium · 0 upvotes · 0 comments

---

Tags: [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/all-your-gucs-in-a-row-deadlock-timeout-3g1yv7vql)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"All Your GUCs in a Row: deadlock_timeout","url":"https://daily.dev/posts/all-your-gucs-in-a-row-deadlock-timeout-3g1yv7vql","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/all-your-gucs-in-a-row-deadlock-timeout-3g1yv7vql"},"datePublished":"2026-06-10T01:01:34.444Z","dateModified":"2026-06-10T01:01:55.460Z","description":"PostgreSQL's `deadlock_timeout` parameter is commonly misunderstood: it doesn't control how long a deadlock is tolerated, but rather how long a process waits...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e1b01adad7ce6fd254248767b96f8810?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e1b01adad7ce6fd254248767b96f8810?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Planet PostgreSQL","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet PostgreSQL","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/planet-postgresql"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/all-your-gucs-in-a-row-deadlock-timeout-3g1yv7vql","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"postgresql","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet PostgreSQL","item":"https://daily.dev/sources/planet-postgresql"},{"@type":"ListItem","position":3,"name":"All Your GUCs in a Row: deadlock_timeout"}]}
```

