# create database (note: connect to "postgres" database)

# the schemas are in schemas/ (duh)

$ psql "host=localhost port=5432 dbname=postgres user=wouter sslmode=disable" < pg_create_db.sql

 

# create schema (note: connect to newly created "ocrui" database as user "ocrui")

psql "host=localhost port=5432 dbname=ocrui user=ocrui sslmode=disable" < pg_create_schema.sql

 

-OR-

 

# create schema (note: connect to newly created "ocrui" database as admin user "wouter")

psql "host=localhost port=5432 dbname=ocrui user=wouter sslmode=disable" < pg_create_schema.sql

 

# ... and then change ownership (creator always owns by default):

reassign owned by wouter to ocrui;

 

# when manually working as the admin user, set search_path for the session.

=> set search_path = ocrui,public;

=> \dt

 

 

  • No labels