[英]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.