public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrien NAYRAT <[email protected]>
To: [email protected]
Subject: Mention FK creation take ShareRowExclusiveLock on referenced table
Date: Tue, 18 Sep 2018 12:32:54 +0200
Message-ID: <[email protected]> (raw)

Hello,

A few days ago I was surprised a CREATE TABLE containing FK constraint 
was stuck due to an automatic vacuum freeze (which took 
ShareUpdateExclusiveLock if I remember) on referenced table.

After digging into the code I found theses lines in tablecmds.c :


/*
  * Grab ShareRowExclusiveLock on the pk table, so that someone doesn't
  * delete rows out from under us.
  */


Maybe it should be documented in theses pages?

https://www.postgresql.org/docs/current/static/sql-createtable.html
https://www.postgresql.org/docs/current/static/sql-altertable.html

If you agree I can send a patch.

Regards,




view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Mention FK creation take ShareRowExclusiveLock on referenced table
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox