Azure Postgresql how to create a CAST

Laurens van der Stoep (NL) 35 Reputation points
2023-09-20T14:27:04.6333333+00:00

Hello,

I am currently in the process of configuring a database within Azure Database for PostgreSQL flexible server. However when i try to create two CAST objects i get the following error: ERROR: must be owner of type integer or type text.

Queries:

CREATE CAST (integer AS text) 
WITH FUNCTION text(integer) 
AS IMPLICIT;

CREATE CAST (bytea as text)
WITH FUNCTION bytea2text(bytea)
AS implicit;

When i run the query below i see that the owner of type text is azuresu.

SELECT typowner::regrole 
  FROM pg_type t 
 	WHERE typname = 'text';

How can i resolve this issue and why am i not owner if the types in my own database?

Azure Database for PostgreSQL
{count} votes

2 answers

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,201 Reputation points Microsoft Employee
    2023-09-26T08:10:20.3033333+00:00

    Hi Laurens van der Stoep (NL) •,

    Thanks for your patience.

    I have got the below reply from the internal team:

    Currently, the super user is the owner of the system defined datatypes in Flexible Servers. We are evaluating the options if we can provide the functionality to alter the ownership of the data types to azure_pg_admin or not.
    We will be providing an update once our analysis is complete.

    We appreciate your patience until team shares its analysis.

    Thank you.


  2. Javier Andres Veliz Miranda 0 Reputation points
    2024-04-19T16:19:59.39+00:00

    Hola, tengo el mismo error, Se encontro alguna solucion para esto ?

    0 comments No comments