create database, user

Поиск
Список
Период
Сортировка
От Thorsten Haude
Тема create database, user
Дата
Msg-id 20020310182306.GS808@eumel.yoo.net
обсуждение исходный текст
Ответы Re: create database, user  (Oliver Elphick <olly@lfix.co.uk>)
Re: create database, user  ("Josh Berkus" <josh@agliodbs.com>)
Список 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 по дате отправления:

Предыдущее
От: "Robert J. Sanford, Jr."
Дата:
Сообщение: Re: Good tutorial wanted...
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: create database, user