如何防止桌子掉落? [英] How to prevent table from being dropped?
问题描述
在PostgreSQL中,如何防止任何人(包括超级用户)删除某些特定表?
In PostgreSQL, how can I prevent anyone (including superusers) from dropping some specific table?
编辑 >:哇,我们在这里有误会吗?假设有一个大型的共享质量检查数据库。有时人们会错误地在其上运行诸如休眠生成的架构之类的破坏性操作,而我正在寻找防止此类错误的方法。
EDIT: Whoa, did we have some misunderstanding here. Let's say there is a big, shared QA database. Sometimes people run destructive things like hibernate-generated schema on it by mistake, and I'm looking for ways to prevent such mistakes.
推荐答案
您可以通过编写一些附加到 ProcessUtility_hook
的C代码来做到这一点。如果您从未做过那样的事情,那将不是一件容易的事,但这是可能的。
You can do that by writing some C code that attaches to ProcessUtility_hook
. If you have never done that sort of thing, it won't be exactly trivial, but it's possible.
另一个选择也许是研究sepgsql,但我没有有任何经验。
Another option might be looking into sepgsql, but I don't have any experience with that.
这篇关于如何防止桌子掉落?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!