Search Postgresql Archives

Re: Understanding database schemas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux