Pool Cloud SQL PostgreSQL connections using PgBouncer
Asked Answered
R

0

6

We are new to Google Cloud SQL and have been trying to integrate pgbouncer with Google Cloud SQl Postgres and authenticate database users with SECURITY DEFINER function (which queries pg_shadow)

Our Configuration:

  • Server -> Pgbouncer + Cloud sql proxy (side car) -> Cloud SQL Postgres

Problem:

  • But as cloud sql postgres actually does not allow to read pg_shadow from a privileged user (i.e postgres user is not a superuser). This makes it impossible to setup pgbouncer with SECURITY DEFINER function.
  • Cloud SQL doesn't provide customers to use superuser (cloudsqladmin)

We've read through many articles (mostly cloud-proxy issues) where they have suggested to use pgbouncer but have not elaborated on the above problem.

Options not applicable:

  • Application level pooling (not feasible right now for us)
  • Authenticating using auth_file eg. users_list.txt (not recomended, needs manual management of database users)

What we are looking for:

  • We intend to run a single instance of cloudsql-proxy and pgbouncer which proxies and pools connections to cloudsql postgres database.

We would appreciate your help guys!

Rutland answered 9/2, 2022 at 12:10 Comment(3)
Responding on the GitHub issue: github.com/GoogleCloudPlatform/cloudsql-proxy/issues/1099.Conservatism
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.Menton
Hi @CengizCan the question has been answered by enocom. You can refer to whole discussion in the link (GitHub issue) provided above in the comment (github.com/GoogleCloudPlatform/cloudsql-proxy/issues/1099). Thank You.Rutland

© 2022 - 2024 — McMap. All rights reserved.