简体   繁体   English

使用 Postgresql 以非超级用户用户身份创建演员表

[英]Create cast as a non-superuser user with Postgresql

I have a specific need to create a new cast in postgresql 9.6:我特别需要在 postgresql 9.6 中创建一个新的演员表:

CREATE OR REPLACE FUNCTION boolean_to_float(b boolean) RETURNS float AS $$
SELECT b::int::float;$$ LANGUAGE SQL;
DROP CAST IF EXISTS (boolean as float);
CREATE CAST (boolean AS float) WITH FUNCTION boolean_to_float(boolean) ;

Unfortunately, I got the following response:不幸的是,我得到了以下回复:

ERROR:  must be owner of type boolean or type double precision

The database is owned by the user I am using.数据库归我使用的用户所有。 Is it possible to force the DROP/CREATE CAST ?是否可以强制DROP/CREATE CAST

正如错误消息所说:你必须以用户postgres身份连接才能做到这一点。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 非超级用户数据库管理 - Non-SuperUser Database Management Postgresql 外部数据包装器错误 如果服务器未请求密码,则非超级用户无法连接 - Postgresql Foreign data wrapper error Non-superuser cannot connect if the server does not request a password 使用非超级用户帐户获取大对象的实际数据 - Get the actual data of the large object using non-superuser account DEFAULT PRIVILEGES 语句是否可能由另一个非超级用户角色所有? - Is it possible for DEFAULT PRIVILEGES statements to be owned by another non-superuser role? 如果服务器在使用 dblink 时不请求密码,则非超级用户无法连接 - Non-superuser cannot connect if the server does not request a password while using dblink 如何授予非超级用户特权以执行函数pg_read_binary_file? - How to GRANT priveleges to non-superuser to execute function pg_read_binary_file? compose - 如何创建具有超级用户或复制角色的 PostgreSQL 用户? - compose - how to create a PostgreSQL user with superuser or replication roles? 如何在没有超级用户帐户的情况下创建postgresql超级用户? - How to create a postgresql superuser without a superuser account? Postgresql 错误:必须是超级用户才能创建基本类型 - Postgresql ERROR: must be superuser to create a base type PostgreSQL | 剩余的连接槽保留用于非复制超级用户连接 - Postgresql | remaining connection slots are reserved for non-replication superuser connections
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM