Following the example with github.com/jackc/pgx/v5 doesn't work #3545
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
samples
Issues that are directly related to samples.
stale: old
Pull request is old and needs attention.
triage me
I really want to be triaged.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
The issue you're having must be related to a file in this repository. We are unable to provide assistance for issues unrelated to samples in this repository.
Please include as much information as possible:
In which file did you encounter the issue?
https://github.com/GoogleCloudPlatform/golang-samples/blob/HEAD/cloudsql/postgres/database-sql/connect_connector_iam_authn.go
Did you change the file? If so, how?
Use
github.com/jackc/pgx/v4
instead ofgithub.com/jackc/pgx/v5
andgithub.com/jackc/pgx/v4/stdlib
instead ofgithub.com/jackc/pgx/v5/stdlib
.Set
usePrivate
totrue
.Describe the issue
Following the mentioned code sample, I would get the error
After trial and error, I followed https://pkg.go.dev/cloud.google.com/go/cloudsqlconn#section-documentation and out of curiosity tried
github.com/jackc/pgx/v4
instead ofgithub.com/jackc/pgx/v5
and the IAM connection started to work.It seems something doesn't work with
github.com/jackc/pgx/v5
and private IP. I suggest you revert #3306 to avoid other people running into this issue. Or even better, make it work with private IP andgithub.com/jackc/pgx/v5
.Have a nice day!
The text was updated successfully, but these errors were encountered: