sudo -u postgres createuser --superuser $USER
For long term stability, I suppose I may take for granted that the LTS Ubuntu version of PostgreSQL would be better then installing through the PostgreSQL apt
The documentation I found on post installation setup suggests that configuration may not be so diffucult.
Nevertheless I have a question about PostgreSQL superuser properties.
All the information (see for instance at help.ubuntu.com and at digitalocean.com) seems to converge on the necessity of creating a database superuser with login name that match my Ubuntu user name with:
This, as far as I have understood, would allow the user and client programs toconnect to the database without requiring a password: would that be working for all my Rails applications too?
If instead I chose to set a password with:
sudo -u postgres psql
should this password match my Ubuntu user password or be different?
In case I chose a different password, I wonder in the first place what advantages there would be in choosing my Ubuntu login name as PostgreSQL superuser.
What is the best choice for Rails: no password, the same Ubuntu user password or a different password?
database.yml is recorded exactly this kind of sensitive information, I suppose there might be security concerns after pushing the application to some Git repository hosting web site and to Heroku. Would you rather suggest to edit .pgpass to keep sensitive information out of the *.yml file?
Finally, with PostgreSQL both in development and production, is the pg gem required?
I would really appreciate any help you can provide.