gpt4 book ai didi

postgresql - 在 postgresql 中只为 1 个表设置只读

转载 作者:行者123 更新时间:2023-11-29 11:49:27 27 4
gpt4 key购买 nike

我只想为数据库中的 1 个表设置只读。我试过命令

ALTER TABLE table SET READ ONLY;

但它不起作用。

有什么办法吗?

最佳答案

我看到了一个答案,希望对你有帮助

REVOKE INSERT, UPDATE, DELETE, TRUNCATE
ON ALL TABLES IN SCHEMA public
FROM public, <target_role>;

Possibly add more roles to the list, but do not forget the role public. Possibly add more schemas to the list, but do not forget the schema public.

关于postgresql - 在 postgresql 中只为 1 个表设置只读,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44650968/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com