Tuesday, April 8, 2014

Setup A Superuser Account With Password On A Postgres Database

I program on Ruby on Rails and when you start off you could use SQLite as the local database, which doesn't require any setup to get things up and running. However, when your application becomes more complicated you should use a production level database such as Postgres locally to make sure production behaviors mirrors local behaviors. 

Here are the commands to setup an account with password and superuser rights.

CREATE ROLE [role_name] WITH LOGIN PASSWORD '[password]';
ALTER ROLE [role_name] SUPERUSER;

No comments:

Post a Comment