debugsqlrailsMinor
PostgreSQL 9.3 Amazon RDS gives error while using UUID-OSSP extension for generating uuid
Viewed 0 times
postgresqlerrorwhileextensiongeneratingamazongivesusingforuuid
Problem
I have created DB instance on RDS and used below function. It gave error while with the same PostgreSQL version on a local development machine it works fine.
here is the error log:
I'm using this function in ruby on rails 3.2 for generating uuid for my schema.
create or replace function uuid() returns uuid as 'uuid-ossp', 'uuid_generate_v1' volatile strict language C;here is the error log:
ERROR: permission denied for language c
********** Error **********
ERROR: permission denied for language c
SQL state: 42501I'm using this function in ruby on rails 3.2 for generating uuid for my schema.
Solution
You appear to be attempting to load uuid-ossp extension by loading the .sql file directly. You should not be doing that on any modern PostgreSQL, and it won't work on RDS.
Use
instead.
Use
CREATE EXTENSION "uuid-ossp";instead.
Code Snippets
CREATE EXTENSION "uuid-ossp";Context
StackExchange Database Administrators Q#78768, answer score: 9
Revisions (0)
No revisions yet.