Defect #38212
closed
Added by Goran Hasse almost 2 years ago.
Updated almost 2 years ago.
Description
I try to install redmine-5.0.4 on FreeBSD 3.1-RELEASE and postgresql 15.1
Then I run
bash
RAILS_ENV=production bundle exec rake db:migrate
I get a permission error
rake aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied for schema public
LINE 1: CREATE TABLE "schema_migrations" ("version" character varyin...
^
Caused by:
PG::InsufficientPrivilege: ERROR: permission denied for schema public
LINE 1: CREATE TABLE "schema_migrations" ("version" character varyin...
^
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
// GH
- Status changed from New to Closed
This problem is not related to the Redmine application, but to your PostgreSQL roles configuration. You may be using a pg user who has not enough privileges.
I think we can close the issue here.
But in my opinion:
At the installation a role and a database owned by that role is
created.
The migrate scripts should take on that role. Read the config/database.yml or something.
Or at least there should be some instruction on how to take that role from the command line.
RAILS_ENV=production bundle exec rake db:migrate
// GH
Maybe the commands in the installation manual is outdated
Example:
psql -U postgres -h localhost
psql (15.1)
postgres=# CREATE ROLE test3 LOGIN ENCRYPTED PASSWORD 'test123' NOINHERIT VALID UNTIL 'infinity';
CREATE ROLE
postgres=# create database test3 with encoding='UTF8' OWNER=test3;
CREATE DATABASE
postgres=# \q
gorhas@www:~ $ psql -U test3 -h localhost test3
psql (15.1)
test3=> create table demo( name varchar default '' );
ERROR: permission denied for schema public
LINE 1: create table demo( name varchar default '' );
^
test3=>
If I do like this... it works
psql -U postgres -h localhost
psql (15.1)
postgres=# create user test4 with encrypted password 'test123';
CREATE ROLE
postgres=# create database test4 template default owner test4;
CREATE DATABASE
postgres=# \q
gorhas@www:~ $ psql -W -U test4 -h localhost test4
Password:
psql (15.1)
test4=> create table demo( name varchar default '' );
CREATE TABLE
test4=>
- Category changed from Database to Documentation
Also available in: Atom
PDF