Must be owner to truncate?
От | Stephen Frost |
---|---|
Тема | Must be owner to truncate? |
Дата | |
Msg-id | 20050707164050.GH24207@ns.snowman.net обсуждение исходный текст |
Ответы |
Re: Must be owner to truncate?
Re: Must be owner to truncate? |
Список | pgsql-hackers |
Greetings, The current permissions checks for truncate seem to be excessive. It requires that you're the owner of the relation insteadof requiring that you have delete permissions on the relation. It was pointed out that truncate doesn't call triggersbut it seems like that would be something easy enough to check for. My thinking is to replace the existing ownercheckwith: Must have delete permissions on the relation If the relation has triggers: Check that the caller is the owner of the relation,if so, then issue a NOTICE that those triggers won't be called and perform the truncate. If not the owner,then error out saying there are ON DELETE triggers and that you're not the owner. I can submit a patch for this today if there's general agreement on this change. An alternative that was mentioned wasto make 'delete' smart enough to know when it's delete'ing all the rows and there aren't any triggers on it, etc, to performlike truncate, perhaps leaving the old file around until all transactions using it have finished. This sounds likea good idea but also sounds like it'd be a larger change and might have to wait till 8.2. Thanks, Stephen
В списке pgsql-hackers по дате отправления: