I have a PostgreSQL instance on Google Cloud SQL, and I am trying a simple COPY command to load a CSV file in a Cloud Storage bucket.
COPY shapes (key_code, pref, city)
FROM 'gs://my_bucket/data.csv'
DELIMITER ','
CSV HEADER;
When I run it in Cloud SQL Studio, I get the error:
Details: pq: permission denied to COPY from a file
I've tried looking at some tutorials, and they all say I need to locate the service account for my CloudSQL instance. The only one I can find looks like <some_id>-<another_id>@gcp-sa-cloud-sql.iam.gserviceaccount.com (In the middle of the CloudSQL instance landing page).
I've given it Storage Object Viewer on IAM and I've verified that permission on Cloud Storage.
What am I missing?