Don't set a fast default for anything but a plain table
Andrew Dunstan <andrew@dunslane.net>
Don't set a fast default for anything but a plain table The fast default code added in Release 11 omitted to check that the table a fast default was being added to was a plain table. Thus one could be added to a foreign table, which predicably blows up. Here we perform that check. In addition, on the back branches, since some of these might have escaped into the wild, if we encounter a missing value for an attribute of something other than a plain table we ignore it. Fixes bug #17056 Backpatch to release 11, Reviewed by: Andres Freund, Álvaro Herrera and Tom Lane
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/heap.c | modified | +9 −1 |
| src/backend/commands/tablecmds.c | modified | +3 −2 |
| src/backend/utils/cache/relcache.c | modified | +18 −1 |
| src/test/regress/expected/fast_default.out | modified | +19 −0 |
| src/test/regress/sql/fast_default.sql | modified | +14 −0 |