setting the pguser environment variable

Asked by Kinuthia

 Hi!
I installed Postgrel 8.3.0 through Synaptic Manager, now I cannot create a database because from the documentation, I do not have a user account ! After scouring the documentation I found that I need to set the PGUSER environment variable to specify my Postgrel user name. How do I set that variable?
It also says I could use the - U switch. What is that?
Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Hans Spaans
Solved:
Last query:
Last reply:
Revision history for this message
Best Hans Spaans (hspaans) said :
#1

When you run the following command you will get the permissions to login to postgresql and create roles and databases.

# sudo su - postgres -c psql

Using the PGUSER only works for the postgres user in Debian installations and for all other users you need to identify yourself with username password, but it seems you already read about the -U option.

Revision history for this message
Kinuthia (qmuchane) said :
#2

Thanks Hans,I managed to log into Postgresql at the first attempt! Hmmmmmm...but I wonder why the documentation does not offer an easy way to do it.