Thread: createdb

createdb

From
Greg Donald
Date:
I install Postgresql from source.  It was fairly painless.  I have
postmaster up and running as an unpriveledged user 'ralph'.  I recompiled
PHP to add Postgresql support, that went swell too.

Next, I wanted to create a new database name Test.  Do I do this as root,
as my new user 'ralph', or as my regular unix username?  I want the owner
of the database to be fairly unpriveledged too since I plan to access this
database with PHP.

It's sort of confusing in the docs, when I try the examples I'm not
allowed to create a database.  I haven't tried as root yet, wanted to ask
for some help first.

Can someone clear up my confusion?

Thanks,
Greg


Re: createdb

From
Alessio Bragadini
Date:
Greg Donald wrote:

> Next, I wanted to create a new database name Test.  Do I do this as root,
> as my new user 'ralph', or as my regular unix username?

If your user ralph has database creation rights (it was asked when
creating the user) you can do
createdb -U ralph test

or some other db user (postgres) that has the rights to create a new db.

--
Alessio F. Bragadini        alessio@albourne.com
APL Financial Services        http://village.albourne.com
Nicosia, Cyprus             phone: +357-2-755750

"It is more complicated than you think"
        -- The Eighth Networking Truth from RFC 1925