migrate icon indicating copy to clipboard operation
migrate copied to clipboard

Question: migrate or implement pgx v5 driver

Open m-chrome opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

PGX driver V5 was released - https://pkg.go.dev/github.com/jackc/pgx/v5.

Describe the solution you'd like

  1. I suggest migrating from pgx v4 to pgx v5 OR write new PgxV5 driver implementation
  2. Update pgx4 module to latest 4.17.2, if need to have v4 driver

m-chrome avatar Oct 17 '22 16:10 m-chrome

This is causing me problems as well.

As far as I can see it's not possible to import both github.com/jackc/pgx/v5 and github.com/golang-migrate/migrate/v4/database/pgx (which uses github.com/jackc/pgx/v4) as it results in a runtime panic panic: sql: Register called twice for driver pgx.

alexedwards avatar Oct 20 '22 16:10 alexedwards

We are now experiencing the same exception as @alexedwards.

mprimeaux avatar Jan 07 '23 01:01 mprimeaux

As of pgx 4.18.1 and 5.3.1, it should now be possible to import the stdlib compatibility layer from multiple versions of pgx (see https://github.com/jackc/pgx/issues/1480). This might unblock people for now, and hopefully https://github.com/golang-migrate/migrate/pull/848 will be merged soon so we only need to import one version at all

(@alexedwards @mprimeaux, tagging because you mentioned you were having the runtime panic issue)

treuherz avatar Mar 17 '23 14:03 treuherz