I have a Postgresql database that is running on premises which I want to import into Google Cloud SQL. My database is called test
and is owned by user test
Steps I've taken:
- created Cloud SQL instance
created database on Cloud SQL instance:
curl --header "Authorization: Bearer XXXXX" \ --header 'Content-Type: application/json' \ --data '{"project": "YYYYYY", "instance": "dev", "name": "test"}' \
https://www.googleapis.com/sql/v1beta4/projects/YYYYYY/instances/dev/databases -X POST
Created
test
user:gcloud beta sql users create test host --instance=dev --password=test
- Dumped DB from source db with
pg_dump
- Tried to restored ... got this error:
ERROR: must be member of role test
So how do I execute import under test
user?