RegisterDriver registers a Postgres driver that uses the cloudsqlconn.Dialer
configured with the provided options. The choice of name is entirely up to
the caller and may be used to distinguish between multiple registrations of
differently configured Dialers. The driver uses pgx/v4 internally.
RegisterDriver returns a cleanup function that should be called one the
database connection is no longer needed.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-05 UTC."],[[["\u003cp\u003eThe latest version of the Cloud SQL Postgres driver for pgx v4 is 1.16.0.\u003c/p\u003e\n"],["\u003cp\u003eThis webpage provides access to multiple versions of the Cloud SQL Postgres driver, ranging from version 0.1.0 up to the latest 1.16.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epgxv4\u003c/code\u003e package is a Cloud SQL Postgres driver using pgx v4, and it is compatible with the database/sql package.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eRegisterDriver\u003c/code\u003e function within this package allows you to register a Postgres driver with cloudsqlconn.Dialer, enabling customized configurations and management of database connections, and returns a cleanup function.\u003c/p\u003e\n"],["\u003cp\u003eThere is a link to view the package on pkg.go.dev if you need more information about this package and older versions.\u003c/p\u003e\n"]]],[],null,["# Package cloud.google.com/go/cloudsqlconn/postgres/pgxv4 (v1.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.16.0 (latest)](/go/docs/reference/cloud.google.com/go/cloudsqlconn/latest/postgres/pgxv4)\n- [1.15.0](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.15.0/postgres/pgxv4)\n- [1.14.2](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.14.2/postgres/pgxv4)\n- [1.13.2](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.13.2/postgres/pgxv4)\n- [1.12.1](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.12.1/postgres/pgxv4)\n- [1.11.1](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.11.1/postgres/pgxv4)\n- [1.10.1](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.10.1/postgres/pgxv4)\n- [1.9.0](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.9.0/postgres/pgxv4)\n- [1.8.1](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.8.1/postgres/pgxv4)\n- [1.7.0](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.7.0/postgres/pgxv4)\n- [1.6.0](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.6.0/postgres/pgxv4)\n- [1.5.2](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.5.2/postgres/pgxv4)\n- [1.4.3](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.4.3/postgres/pgxv4)\n- [1.3.0](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.3.0/postgres/pgxv4)\n- [1.2.4](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.2.4/postgres/pgxv4)\n- [1.1.1](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.1.1/postgres/pgxv4)\n- [1.0.1](/go/docs/reference/cloud.google.com/go/cloudsqlconn/1.0.1/postgres/pgxv4)\n- [0.5.2](/go/docs/reference/cloud.google.com/go/cloudsqlconn/0.5.2/postgres/pgxv4)\n- [0.4.0](/go/docs/reference/cloud.google.com/go/cloudsqlconn/0.4.0/postgres/pgxv4)\n- [0.3.1](/go/docs/reference/cloud.google.com/go/cloudsqlconn/0.3.1/postgres/pgxv4)\n- [0.2.0](/go/docs/reference/cloud.google.com/go/cloudsqlconn/0.2.0/postgres/pgxv4)\n- [0.1.0](/go/docs/reference/cloud.google.com/go/cloudsqlconn/0.1.0/postgres/pgxv4) \n**Note:** To get more information about this package, such as access to older versions, view [this package on pkg.go.dev](https://pkg.go.dev/cloud.google.com/go/cloudsqlconn/postgres/pgxv4). \n\u003cbr /\u003e\n\nPackage pgxv4 provides a Cloud SQL Postgres driver that uses pgx v4 and works\nwith the database/sql package. \n\nFunctions\n---------\n\n### func RegisterDriver\n\n func RegisterDriver(name https://pkg.go.dev/builtin#string, opts .../go/docs/reference/cloud.google.com/go/cloudsqlconn/latest./go/docs/reference/cloud.google.com/go/cloudsqlconn/latest#cloud_google_com_go_cloudsqlconn_Option) (func() https://pkg.go.dev/builtin#error, https://pkg.go.dev/builtin#error)\n\nRegisterDriver registers a Postgres driver that uses the cloudsqlconn.Dialer\nconfigured with the provided options. The choice of name is entirely up to\nthe caller and may be used to distinguish between multiple registrations of\ndifferently configured Dialers. The driver uses pgx/v4 internally.\nRegisterDriver returns a cleanup function that should be called one the\ndatabase connection is no longer needed."]]