You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ visudo
# This allows user to sudo but prompts for password
dog ALL=(ALL:ALL) ALL
# This allows user to sudo without prompting for password (not very secure but useful during automation)
dog ALL=(ALL:ALL) NOPASSWD:ALL
Use Ident Authentication whenever possible. Basically this means access to the database uses the currently logged in user on the OS. For example: if your Rails application runs as the user dog connections to the PG database will use that user.
Commands/Actions
Become a PostgreSQL super user (postgres) to perform database operations unimpeded:
From root: $ su - postgres
From sudo: $ sudo su - postgres
Permit user to create databases:
$ psql
> ALTER USER username CREATEDB;
Create a database and permit the current user: $ createdb database_name
Rails
Example database.yml with PostgreSQL & Ident Authentication