cannot CREATE CAST PostgreSQL 9.6

267 views
Skip to first unread message

javier.g...@ingennia.cl

unread,
Aug 1, 2018, 9:00:53 AM8/1/18
to Google Cloud SQL discuss
CREATE CAST (text AS smallint) WITH INOUT AS IMPLICIT;

=> ERROR:  must be owner of type text or type smallint

Any alternative or solution to this? 
It's really pushing me back on Google SQL as an alternative.

George (Cloud Platform Support)

unread,
Aug 2, 2018, 4:47:18 PM8/2/18
to google-cloud...@googlegroups.com
Hello Javier, 

To be able to create a cast, you must own the source or the target data type and have USAGE privilege on the other type. You may have a look at the "CREATE CAST" documentation page

If you use WITHOUT FUNCTION, you must enjoy superuser privileges. This is never the case in Cloud SQL PostgreSQL. In what context do you call the CREATE CAST statement? What would you like to achieve? A detailed use-case would definitely help in defining and clarifying the scope of the issue. 

Daniel Joyce

unread,
Oct 5, 2018, 3:29:55 PM10/5/18
to Google Cloud SQL discuss
We need custom casts to simplify certain kinds of queries. This is a useful feature in general given postgres' support of custom data types. Its sad there is no easy way to do this.

-Daniel

George (Cloud Platform Support)

unread,
Oct 5, 2018, 5:31:59 PM10/5/18
to google-cloud...@googlegroups.com
Hi Javier, 

If you think your feature is needed and helpful for many, you are encouraged to open a similarly formulated issue in the Public Issue Tracker. To facilitate issue assessment and Engineering work towards its implementation, a detailed use-case would definitely help in defining and clarifying the scope of the issue. This use-case should refer to and incorporate the context of your CREATE CAST statement, and its ultimate purpose: what you'd like to achieve.

Daniel Joyce

unread,
Oct 7, 2018, 10:40:35 AM10/7/18
to Google Cloud SQL discuss
Also it would be nice to be able to add casts for existing types, which are currently owned by cloudsqladmin :/

George (Cloud Platform Support)

unread,
Oct 7, 2018, 11:30:42 AM10/7/18
to Google Cloud SQL discuss
Hello Daniel, 

You are similarly encouraged to open a feature request in the Public Issue Tracker, with a detailed use-case, and explanation of the need for the new feature. One feature request per issue in Tracker makes assessment and implementation easier. 
Reply all
Reply to author
Forward
0 new messages