Skip to content

Commit 715f229

Browse files
authored
Merge pull request #161 from carise/patch-1
Update data import instructions in README.md
2 parents 68f2b09 + d3721a8 commit 715f229

File tree

1 file changed

+6
-2
lines changed
  • bootcamp/materials/1-dimensional-data-modeling

1 file changed

+6
-2
lines changed

bootcamp/materials/1-dimensional-data-modeling/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ There are two methods to get Postgres running locally.
4747
2. Run this command after replacing **`<computer-username>`** with your computer's username:
4848
4949
```bash
50-
psql -U <computer-username> postgres < data.dump
50+
pg_restore -U <computer-username> postgres data.dump
5151
```
5252
5353
3. Set up DataGrip, DBeaver, or your VS Code extension to point at your locally running Postgres instance.
@@ -115,6 +115,10 @@ There are two methods to get Postgres running locally.
115115
- If the test connection is successful, click "Finish" or "Save" to save the connection. You should now be able to use the database client to manage your PostgreSQL database locally.
116116
117117
## **🚨 Tables not loading!? 🚨**
118+
- If you're seeing errors about `error: invalid command \N`, you should use `pg_restore` to load `data.dump`.
119+
```bash
120+
pg_restore -U $POSTGRES_USER -d $POSTGRES_DB data.dump
121+
```
118122
- If you are on Windows and used **`docker compose up`**, table creation and data load will not take place with container creation. Once you have docker container up and verified that you are able to connect to empty postgres database with your own choice of client, follow the following steps:
119123
1. On Docker desktop, connect to my-postgres-container terminal.
120124
2. Run:
@@ -123,7 +127,7 @@ There are two methods to get Postgres running locally.
123127
-v ON_ERROR_STOP=1 \
124128
--username $POSTGRES_USER \
125129
--dbname $POSTGRES_DB \
126-
< /docker-entrypoint-initdb.d/data.dump>
130+
< /docker-entrypoint-initdb.d/data.dump
127131
```
128132
- → This will run the file `data.dump` from inside your docker container.
129133

0 commit comments

Comments
 (0)