[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: newbie postgresql question



Charles Lewis wrote:
  >Just installed postgresql 7 and went through the config files and everything
  >looks fine. Log in with my user account and open up pgaccess to create a new
  >database and get the following error:
  >
  >  Tcl error executing pg_exec
  >  create database invoice
  >
  >  is not a valid postgresql
  >  connection
  >
  >If I log in as user postgres, I can run psql, but if I try to run psql under
  >another user I get:
  >
  >  psql: FATAL 1: SetUserId: user 'chas' is not in 'pg_shadow'
  >
  >I imagine that I have to add myself to some group or something, but I have
  >absolutely no idea where to start looking.
  >
  >I've read some postgres documentation, but debian apparently does things a
  >little differently. Any suggestions?
 
The only user that exists when the database structure is first created is
'postgres'; you have to become 'postgres' before you can create any other
users:

 fred $ su
 root # su - postgres
 postgres $ createuser fred
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
 postgres $ exit
 root # exit
 fred $ createdb fred
 fred $ psql -d fred


  
-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "The LORD is my shepherd; I shall not want. He maketh 
      me to lie down in green pastures: he leadeth me beside
      the still waters, he restoreth my soul...Surely
      goodness and mercy shall follow me all the days of my
      life; and I will dwell in the house of the LORD for
      ever."                    Psalms 23:1,2,6 




Reply to: