Re: [HACKERS] Validating CHECK constraints with SPI

2014-10-29 Thread Dan Robinson
On Wed, Oct 29, 2014 at 7:17 AM, Alvaro Herrera wrote: > Dan Robinson wrote: > > Hi all, > > > > If I'm reading correctly in src/backend/commands/tablecmds.c, it looks > like > > PostgreSQL does a full table scan in validateCheckConstraint and in the &

[HACKERS] Validating CHECK constraints with SPI

2014-10-29 Thread Dan Robinson
Hi all, If I'm reading correctly in src/backend/commands/tablecmds.c, it looks like PostgreSQL does a full table scan in validateCheckConstraint and in the constraint validation portion of ATRewriteTable. Since the table is locked to updates while the constraint is validating, this means you have