Re: [HACKERS] Happy column dropping
От | Peter Eisentraut |
---|---|
Тема | Re: [HACKERS] Happy column dropping |
Дата | |
Msg-id | Pine.LNX.4.21.0001242215060.525-100000@localhost.localdomain обсуждение исходный текст |
Ответ на | Re: [HACKERS] Happy column dropping (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [HACKERS] Happy column dropping
|
Список | pgsql-hackers |
On 2000-01-22, Tom Lane mentioned: > > 2) how do I find out if the dropped column is referenced in a constraint, > > trigger, rule (this is necessary for a correct RESTRICT/CASCADE > > implementation) > > Actually it's worse than that: you need to be prepared to renumber the > columns after the dropped one, too. Probably what you will need to do > is read in and deparse all the relevant rules and triggers, then reparse > them against the updated table schema. Ugly. And no, I have no idea > how you even *find* all the relevant rules. (Jan?) Perhaps their should be a pg_attribute.attisusedbytrigger::oid, pg_attribute.attisconstrainedbyconstr::oid, etc. Eventually, I think, this is unavoidable if you want DROP TABLE to do the right thing as well, and scanning and decoding possibly hundreds of rules, triggers, and constraints won't get you far. -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden
В списке pgsql-hackers по дате отправления: