During ALTER TABLE ADD FOREIGN KEY, try to check the existing rows using
Tom Lane <tgl@sss.pgh.pa.us>
During ALTER TABLE ADD FOREIGN KEY, try to check the existing rows using a single LEFT JOIN query instead of firing the check trigger for each row individually. Stephan Szabo, with some kibitzing from Tom Lane and Jan Wieck.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/tablecmds.c | modified | +8 −1 |
| src/backend/utils/adt/ri_triggers.c | modified | +217 −9 |
| src/include/commands/trigger.h | modified | +4 −1 |