Re: Understanding database schemas - Mailing list pgsql-general

From Bosco Rama
Subject Re: Understanding database schemas
Date
Msg-id 51FBE4C9.90509@boscorama.com
Whole thread Raw
In response to Understanding database schemas  (Melvin Call <melvincall979@gmail.com>)
Responses Re: Understanding database schemas  (Melvin Call <melvincall979@gmail.com>)
List pgsql-general
On 08/02/13 09:33, Melvin Call wrote:
>
> $ psql -U postgres
>
> DROP SCHEMA IF EXISTS hrschema CASCADE;
> DROP DATABASE IF EXISTS personnel;
> DROP USER IF EXISTS hr_admin;
>
> CREATE USER hr_admin
>    WITH CREATEDB
>    PASSWORD 'md5be394806d6a21c6c52aa2b76063c7d9d';
>
> DROP DATABASE IF EXISTS personnel;
> CREATE DATABASE personnel
>    WITH ENCODING='UTF8'
>    OWNER=hr_admin
>    TEMPLATE=template0
>    LC_COLLATE='C'
>    LC_CTYPE='C'
>    CONNECTION LIMIT=-1;
>
> CREATE SCHEMA hrschema
> AUTHORIZATION hr_admin;

You've created 'hrschema' schema in the 'postgres' database at this
point.

You'll need to connect to the 'personnel' database before issuing this
DDL command.  And since you are reconnecting, you may as well do it as
the 'hr_admin' user and skip the whole 'authorization' clause.

HTH,
Bosco.


pgsql-general by date:

Previous
From: hamann.w@t-online.de
Date:
Subject: Re: incremental dumps
Next
From: Perry Smith
Date:
Subject: TOC errors