Create Function with LANGUAGE c gets ERROR: permission denied for language c

ITAdmin - TOLFIN 0 Reputation points
2024-07-09T01:40:44.7566667+00:00

We are migrating a database from PostgresSQL single server to flexible server using psql to dump and restore.
All those functions with 'language c' would return ERROR: permission denied for language c

A sample function like this:
CREATE OR REPLACE FUNCTION public.unaccent_lexize(internal, internal, internal, internal)
RETURNS internal
LANGUAGE c
PARALLEL SAFE AS '$libdir/unaccent', $function$unaccent_lexize$function$;

We tried to enable language c support but seems the admin account we created does not have the authority to do so.

Any help would be appreciated.

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 24,531 Reputation points
    2024-07-09T09:54:06.2433333+00:00

    To create functions in the C language, superuser access is required. Additionally, it is strongly advised against updating catalog tables directly. As you do not have superuser access, you were prevented from potentially causing significant issues.

    If you do not possess superuser privileges (which is preferable, considering your recent attempts), you'll need to request your DBA to execute these statements on your behalf.

    https://stackoverflow.com/questions/77046116/how-to-overcome-the-error-permission-denied-for-language-c

    https://stackoverflow.com/questions/7014437/error-permission-denied-for-language-c

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.