[HACKERS] FOREIGN KEY ... CONCURRENTLY

2014-01-29 Thread David Fetter
Esteemed hackers, I can't be the only person to have encountered a situation where adding a new foreign key pointing at a busy table essentially never happens because the way things work now, creating the constraint trigger on that busy table requires an AccessExclusive lock, or a unicorn,

Re: [HACKERS] FOREIGN KEY ... CONCURRENTLY

2014-01-29 Thread Alvaro Herrera
David Fetter wrote: 2) Is there another way to solve the problem of adding a foreign key constraint that points at a busy table? Add it as NOT VALID and do a later VALIDATE CONSTRAINT step, after the patch to reduce lock levels for ALTER TABLE goes in, perhaps? -- Álvaro Herrera