create database, user - Mailing list pgsql-novice

From Thorsten Haude
Subject create database, user
Date
Msg-id 20020310182306.GS808@eumel.yoo.net
Whole thread Raw
Responses Re: create database, user
Re: create database, user
List pgsql-novice
Hi,

I want to create a database and a matching user for a web application.
I want to do all that from an SQL file but I have problems with both
'create database' and 'create user'.

- I have still not grasped how I should connect to the DBMS for things
like that; there is no root. Is there a document describing best
practices somewhere?

- Are there any special provisions you have to follow to do create
database, user, tables and other object with one SQL file?

For the ones knowing MySQL, what I want to do is something like this:
- - - Schnipp - - -
[Connect as Administrator]
create database dbName;

grant all
    on dbName
    to userName
    identified by 'secret';

use inventory;

create table items
(
    [...]
);
- - - Schnapp - - -

Thanks in advance for any help!

Thorsten
--
Die Zensur ist das lebendige Geständnis der Großen, daß sie nur
verdummte Sklaven aber keine freien Völker regieren können.
    - Johann Nepomuk Nestroy

pgsql-novice by date:

Previous
From: "Robert J. Sanford, Jr."
Date:
Subject: Re: Good tutorial wanted...
Next
From: Oliver Elphick
Date:
Subject: Re: create database, user