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

Re: Postgresql Beginner



Bob Bernstein wrote:
  >This novice is confused by the role of the user 'postgres'. It seems I can't
  >do anything with this package unless I first su to root user, then su again 
      >to
  >'postgres' user. 
  
That is correct.  Of course you can choose to give postgres a password and
you would then be able to log in as postgres directly; if the PostgreSQL
administrator is no the system administrator, this would be necessary.

  >I have created a db, such as 'mydatabase,' but I feel like I'm missing
  >something. Surely there's a way to allow an "ordinary" user to use a
  >Postgresql database. 
  
When PostgreSQL is first installed, the only user it knows about is
`postgres'.  So connect as postgres and add new users:

 template1=> CREATE USER newuser;

will create an ordinary user

 template1=> CREATE USER newuser CREATEDB

will create one who can create databases, and 

 template1=> CREATE USER newuser CREATEUSER

one who can create new users (this is insecure - he can also change
any system table.)

  >One symptom of my ignorance is that in trying to run the KDE client (KMySql)
  >when I try to create a form I get a "check permissions" error message.
  
KMySQL presumably connects to MySQL rather than PostgreSQL? (I haven't
heard of it before.)

  >I would gladly be directed to a usable FAQ for beginners. The Postgresql
  >HOW-TO is long on philosophy and testing, but lacking in basic intro kind of
  >stuff.

Start psql, then type \h to get a list of SQL commands
\h command gives more details of that command

There are also man pages (replace spaces with underscores), e.g. `man create_table'.


-- 
      Vote against SPAM: http://www.politik-digital.de/spam/
                 ========================================
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "But what things were gain to me, those I counted loss 
      for Christ."                 Philippians 3:7 



Reply to: