Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    J

    Josh Berkus

    databasesoup.com · Personal blog · on HN since 2012

    Josh Berkus, a PostgreSQL core team member, writes about Postgres administration, schema design, versioning, and consulting.

    Visit blogHN submissions
    DatabasesOpen Source & Linux
    What HN says

    HN commenters recommend his series on xid wraparound and his posts on primary key misuse, citing them in database design discussions.

    Stats for nerds
    39HN people shared it
    36linked in comments
    438story points
    Feb 2019last shared
    2012people per year2019

    Top posts on HN

    1. 1
      Of Booze and Brogrammers
      1 person · 110 points · first shared 2012 · 66 comments on HN
    2. 2
      PostgreSQL needs a new load balancer
      2 people · 108 points · first shared 2012 · 18 comments on HN
    3. 3
      Why HStore2/jsonb is the most important patch of PostgreSQL 9.4
      1 person · 67 points · first shared 2014 · 75 comments on HN
    4. 4
      PipelineDB: streaming Postgres
      1 person · 21 points · first shared 2015 · Discussion on HN
    5. 5
      Sharding Postgres at Instagram
      2 people · 12 points · first shared 2012 · 1 comments on HN
    6. 6
      Please, security test our code!
      1 person · 12 points · first shared 2015 · 1 comments on HN
    7. 7
      Rules of Software Consulting
      1 person · 11 points · first shared 2013 · 2 comments on HN
    8. 8
      PostgreSQL 9.2 - Improvements to pg_stats
      1 person · 10 points · first shared 2012 · 2 comments on HN
    9. 9
      First Look at PostgreSQL RDS on Amazon
      2 people · 9 points · first shared 2013 · 3 comments on HN
    10. 10
      PostgreSQL 9.3: Current Feature Status
      1 person · 9 points · first shared 2013 · Discussion on HN

    What HN people wrote when they linked it

    • MechanicalTwerkFeb 2019

      If you're looking for a good series of blog posts about xid wraparound in Postgres check out these posts by Josh Berkus:

      http://www.databasesoup.com/2012/09/freezing-your-tuples-off-part-1.html

      http://www.databasesoup.com/2012/10/freezing-your-tuples-off-part-2.html

      http://www.databasesoup.com/2012/12/freezing-your-tuples-off-part-3.html

      And this more recent one by Robert Haas:

      https://rhaas.blogspot.com/2018/01/the-state-of-vacuum.html

      As Josh states at the end of the third post the current best practices for dealing with this are really workarounds and as Robert states it requires monitoring and management. Postgres is an amazing piece of software and managing this is doable but IMHO this is one of Postgres' worst warts. It would be awesome if someone could donate some funding to improve this.

    • semiquaverSep 2017

      The very quick exclusive lock that postgres needs for things that are normally thought of as "free" like `ALTER TABLE ADD COLUMN` without a default can still cause problems on tables that are under extremely heavy contention. If you have hundreds of clients running long transactions against a table, even this fast metadata-only lock can cause an outage due to head-of-line blocking. Our team has had good luck with this lock-polling approach for migrations against very busy tables [1]. The idea is that you combine `lock_timeout` and attempt to `LOCK TABLE IN ACCESS EXCLUSIVE MODE` in a loop prior to running the DDL. Note that this is only safe for migrations that are actually instantaneous once the lock is acquired.

      [1] http://www.databasesoup.com/2015/08/lock-polling-script-for-alter-table.html

    • ahacheteApr 2016

      Sure, there's CASCADE, but as you pointed out it has several drawbacks.

      That's why ideally natural keys should be immutable. That has many advantages over surrogate keys.

      There's a follow up post (posts) to this presentation: http://www.databasesoup.com/2015/03/primary-keyvil-reprised.html where many problems caused by the abuse of surrogate keys are illustrated.

      But the main point is simple: surrogate keys (abuse) is an easy way to data corruption. Not in the sense of durability as in ACID, but in the sense of humans (manually or by bugs in the software) duplicating information that is not enforced to be unique thanks to using non-sense surrogate keys as the uniqueness criteria.

    • niermanJul 2015

      Running more aggressive vacuums that will clean up "old" tuples/tables is good for off-peak times. See Josh Berkus' short three part blog series on postgres' vacuum/freeze:
      http://www.databasesoup.com/2012/09/freezing-your-tuples-off-part-1.html

      and his python script for doing this:
      https://github.com/pgexperts/flexible-freeze

      Also, note that long running transactions can prevent cleanup of tuples. Look for old xact_start values of non-idle queries in pg_stat_activity (particularly "idle in transaction" connections) and old entries in pg_prepared_xacts.

    • hcmMay 2015

      Great article. We've just moved a large portion of our async jobs over from Resque to Que because of the huge benefits you get from transactional enqueuing and processing. Performance seems good so far, and if it really becomes an issue, running two queuing systems side by side (one transactional, one high-throughput) seems viable.

      We're super cautious about long-running transactions anyway, as they cause a load of other issues (e.g. http://www.databasesoup.com/2013/11/alter-table-and-downtime-part-ii.html - full blog post coming soon!)

    • grzmFeb 2018

      Largely because the previous version numbering was sometimes confusing for the opposite reason: Postgres "major" releases were sometimes interpreted as point releases. For example, 9.1 to 9.2 was major version jump. While that was understood by those who already understood the versioning scheme, it was often confusing to those outside the community.

      Josh Berkus discusses this here:

      http://www.databasesoup.com/2016/05/changing-postgresql-version-numbering.html

    Related

    Robert Haasrhaas.blogspot.com96 people

    New Features Coming in PostgreSQL 10

    Robert Haas
    Personal · last shared 2026
    Dimitri Fontainetapoueh.org48 people

    Aggregating NBA data, PostgreSQL vs MongoDB

    Dimitri Fontaine
    Personal · last shared 2026
    Aphyraphyr.com551 people

    Hexing the technical interview (2017)

    Aphyr
    Personal · last shared 2026
    Citus Data Blogcitusdata.com224 people

    Citus Unforks from PostgreSQL, Goes Open Source

    Citus Data Blog
    Company · last shared 2026
    CYBERTEC Blogcybertec-postgresql.com94 people

    Postgres scaling advice

    CYBERTEC Blog
    Company · last shared 2026
    Bruce Momjianmomjian.us52 people

    PostgreSQL community impact of 2nd Quadrant purchase

    Bruce Momjian
    Personal · last shared 2025
    2ndQuadrant Blogblog.2ndquadrant.com99 people

    Data Loss at GitLab

    2ndQuadrant Blog
    Company · last shared 2025
    depeszdepesz.com101 people

    Waiting for PostgreSQL 14 – SEARCH and CYCLE clauses

    depesz
    Personal · last shared 2026