Azure/azure-postgresql

pg_restore dbname is missing in command call

ramirezaa opened this issue · 1 comments

When applying the pg_restore command, I kept getting an issue stating that the database name was not set. It seems that the following command was not doing anything:

export PGDATABASE=$TARGET_DATABASE_NAME

I updated the pg_restore call to the following which ended up fixing the issue:

pg_restore -v --no-owner --host="$TARGET_SERVER_NAME.postgres.database.azure.com" --port=5432 --username="$TARGET_USERNAME@$TARGET_SERVER_NAME" --dbname=$TARGET_DATABASE_NAME "$SOURCE_DATABASE_NAME.dump"

Is there any reason as to why this issue would come up?

Thank you for pointing this issue. I could restore it.
But warning errors ignored on restore was 223. That was huge.