Skip site navigation (1) Skip section navigation (2)

create database, user

From: Thorsten Haude <postgresql(at)thorstenhau(dot)de>
To: PostgreSQL Novice ML <pgsql-novice(at)postgresql(dot)org>
Subject: create database, user
Date: 2002-03-10 18:23:06
Message-ID: 20020310182306.GS808@eumel.yoo.net (view raw or flat)
Thread:
Lists: pgsql-novicepgsql-php
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

Responses

pgsql-novice by date

Next:From: Oliver ElphickDate: 2002-03-10 18:58:28
Subject: Re: create database, user
Previous:From: Robert J. Sanford, Jr.Date: 2002-03-08 21:20:51
Subject: Re: Good tutorial wanted...

pgsql-php by date

Next:From: Oliver ElphickDate: 2002-03-10 18:58:28
Subject: Re: create database, user
Previous:From: mark boylanDate: 2002-03-06 03:07:06
Subject: Re: SLL with PHP?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group