Skip to content

Instantly share code, notes, and snippets.

@roukmoute
Created September 18, 2019 11:47
Show Gist options
  • Save roukmoute/aa6217f85d1addee42794b36826a9628 to your computer and use it in GitHub Desktop.
Save roukmoute/aa6217f85d1addee42794b36826a9628 to your computer and use it in GitHub Desktop.
TAOP - Import
[postgres@roukmoute-pc TheArtOfPostgreSQL]$ make dropdb
dropdb --if-exists taop
dropuser --if-exists taop
[postgres@roukmoute-pc TheArtOfPostgreSQL]$ make
createuser -SDr taop
createdb -O taop taop
psql -d taop -c 'create extension btree_gist'
CREATE EXTENSION
psql -d taop -c 'create extension ip4r'
CREATE EXTENSION
psql -d taop -c 'create extension hll'
CREATE EXTENSION
psql -d taop -c 'create extension cube'
CREATE EXTENSION
psql -d taop -c 'create extension earthdistance'
CREATE EXTENSION
psql -d taop -c 'create extension hstore'
CREATE EXTENSION
psql -d taop -c 'create extension intarray'
CREATE EXTENSION
psql -d taop -c 'create extension pg_trgm'
CREATE EXTENSION
pg_restore -U taop -d taop --use-list=./exclude-extensions.list --no-owner ./taop.dump
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 11; 2615 2200 SCHEMA public postgres
pg_restore: [archiver (db)] could not execute query: ERROR: schema "public" already exists
Command was: CREATE SCHEMA public;
pg_restore: [archiver (db)] Error from TOC entry 5136; 0 0 COMMENT SCHEMA public postgres
pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of schema public
Command was: COMMENT ON SCHEMA public IS 'standard public schema';
WARNING: errors ignored on restore: 2
make: *** [Makefile:8: restore] Error 1
[postgres@roukmoute-pc TheArtOfPostgreSQL]$ psql
psql (11.5)
Type "help" for help.
postgres=# \c taop
You are now connected to database "taop" as user "postgres".
taop=# \dt
List of relations
Schema | Name | Type | Owner
--------+------------+-------+-------
public | access_log | table | taop
public | cities | table | taop
public | factbook | table | taop
public | hashtag | table | taop
public | hello | table | taop
public | pubnames | table | taop
public | rate | table | taop
public | rates | table | taop
public | tweet | table | taop
(9 rows)
taop=#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment