Re: TODO-Item: TRUNCATE ... CASCADE
От | Alvaro Herrera |
---|---|
Тема | Re: TODO-Item: TRUNCATE ... CASCADE |
Дата | |
Msg-id | 20060202153427.GA5173@surnet.cl обсуждение исходный текст |
Ответ на | TODO-Item: TRUNCATE ... CASCADE (Joachim Wieland <joe@mcknight.de>) |
Ответы |
Re: TODO-Item: TRUNCATE ... CASCADE
|
Список | pgsql-patches |
Joachim Wieland wrote: > The proposed patch implements TRUNCATE ... CASCADE: > > * %Allow TRUNCATE ... CASCADE/RESTRICT > This is like DELETE CASCADE, but truncates. > > The patch also adds a function makeRangeVarFromRelId() to namespace.c that I > thought would be useful. I hope I didn't overlook something similar that > exists already. That's the wrong way to go about it -- better refactor the code so that a function gets a list of Oids instead of RangeVars, and truncates them. ExecuteTruncate should build the list and pass it down. Also I think all the involved relations should be opened and locked before any of them is touched (so maybe instead of passing Oids you should be passing Relations). > + static > + List* BuildReferencingRelationList(List* oids, List* found_earlier) Minor stylistic gripe: this should be static List * BuildReferencingRelationList(List *oids, List *found_earlier) -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
В списке pgsql-patches по дате отправления: