I've taken on a new client with a Postgres database. First time using Postgres for me.

The app boots in Rails, but the first request produces:

SQL (0.4ms)  SET client_min_messages TO 'panic'
SQL (0.1ms)  SET client_min_messages TO 'notice'
2010-02-01 13:21:28 [FATAL] /!\ FAILSAFE /!\  Mon Feb 01 13:21:28 -0800 2010
  Status: 500 Internal Server Error
  PGError: ERROR:  permission denied for relation sessions
: SELECT * FROM "sessions" WHERE (session_id = E'afd988ab22e046dfcb7283917a71d0de') LIMIT 1 /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in `log'

Here's the relevant part of database.yml:

development:
  adapter:  postgresql
  database: dna_development
  username: railsdev
  password: ra1lsd3v
  host:     localhost

Here are the databases:

postgres=# \l
                List of databases
           Name            |  Owner   | Encoding
---------------------------+----------+----------
 dna_development           | railsdev | UTF8
 postgres                  | postgres | UTF8
 postgres_test_development | railsdev | UTF8
 template0                 | postgres | UTF8
 template1                 | postgres | UTF8
(5 rows)

The dna_development database originally had owner 'dna'. I changed the owner to 'railsdev'. But I can't drop 'dna':

postgres=# drop role dna;
ERROR:  role "dna" cannot be dropped because some objects depend on it
DETAIL:  50 objects in database dna_development
postgres=#

Based on a post I found online, I tried these:

postgres=# alter role railsdev with inherit;
ALTER ROLE
postgres=# alter role dna with inherit;
ALTER ROLE

but no cigar.

I admit I don't understand the structure of roles in Postgres well at all yet, but any help in just getting past this would be greatly appreciated.

Thanks,

Scott

--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to