4

We're currently using PostgreSQL 9.2 in our production database, we want to migrate to a new RDS instance, using PostgreSQL 9.4. However, we need to have permission to create a function, but only superuser can create functions on RDS and my user can't be granted as superuser.

CREATE FUNCTION crosstab50(text, OUT rownumber integer, OUT c1 text,...) 
    RETURNS SETOF record 
    LANGUAGE c 
    STABLE STRICT 
    AS '$libdir/tablefunc', 'crosstab';

But we're getting this error during our restore operation:

ERROR:  permission denied for language c
4

RDS doesn't let you install arbitrary C functions. It's a restricted environment.

crosstab is part of the tablefunc extension. You may be able to CREATE EXTENSION tablefunc if it's on the whitelist but you won't be able to add new variants, even if the underlying C function is already loaded and approved.

|improve this answer|||||
  • I was able to run CREATE EXTENSION tablefunc. How can I use it now ? I'm new to postgres. – Valter Silva Feb 9 '16 at 8:06
  • 1
    You can use all the predefined crosstab variants that come with tablefunc. See \df crosstab*. You cannot create new variants with different arguments. This is a limitation of AWS RDS PostgreSQL, not a limitation of PostgreSQL its self, because Amazon want to keep their RDS systems "sealed". – Craig Ringer Feb 9 '16 at 9:17
  • I see, thank you so much for your effort Craig! – Valter Silva Feb 9 '16 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.