Skip to content

Commit e75a75f

Browse files
authored
Merge pull request #113 from fernandostahelin/main
Postgres not loading data.dump with docker
2 parents 692fbf8 + e2a7b85 commit e75a75f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

bootcamp/materials/1-dimensional-data-modeling/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3.10.6"
21
services:
32
postgres:
43
image: postgres:14

bootcamp/materials/1-dimensional-data-modeling/scripts/init-db.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/bin/bash
22
set -e
33

4-
# Import the data dump
5-
psql \
6-
-v ON_ERROR_STOP=1 \
7-
--username $POSTGRES_USER \
8-
--dbname $POSTGRES_DB \
9-
< /docker-entrypoint-initdb.d/data.dump
10-
4+
# Restore the dump file using pg_restore
5+
pg_restore \
6+
-v \
7+
--no-owner \
8+
--no-privileges \
9+
-U $POSTGRES_USER \
10+
-d $POSTGRES_DB \
11+
/docker-entrypoint-initdb.d/data.dump
1112

1213
# Check if the path is a directory using the -d flag and
1314
# there are SQL files in the directory using the -f command

0 commit comments

Comments
 (0)