user17827423
user17827423

Reputation:

How to import a local .sql into a docker container with postgres

Hi im trying to import my .sql with the creation of tables and inserts into a container database with postgres, something like this...

docker exec postgrescontainer psql -U postgres mydatabase < D:\"My documents"\desk\sql\database.sql

But when i see into the container, nothing happens and the relations of mydatabase are empty.

Upvotes: 0

Views: 2366

Answers (1)

user17827423
user17827423

Reputation:

I achieved adding -i in the flags

docker exec -i postgrescontaineer psql -U postgres mydatabase < D:\"My documents"\desk\sql\database.sql

Upvotes: 2

Related Questions