You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Why do the adapters (postgres, pgx) ignore the config? #547
The config actually has the schema name (potentially already explicitly set), but here it is being ignored unless an orthogonal parameter happens to have some particular value).
Good catch! It looks like the SchemaName and MigrationsTableQuoted config values don't play nicely with each other...
We should default to the config SchemaName and overwrite that if the quoted migration table name also specifies a schema. This should be fixed on both the pgx and postgres drivers.
To be fair, I believe that config value was never respected consistently in the Postgres driver, going back years. The issue was not introduced by the latest changes. I’m pretty sure that a couple of years ago on some project I simply made it use that config value and suddenly it all worked fine (no need for the quoted table name handling, etc.).
Activity
dhui commentedon Apr 20, 2021
Good catch! It looks like the
SchemaNameandMigrationsTableQuotedconfig values don't play nicely with each other...We should default to the config
SchemaNameand overwrite that if the quoted migration table name also specifies a schema. This should be fixed on both the pgx and postgres drivers.dhui commentedon Apr 20, 2021
@stephane-klein do you have time/bandwidth to address this issue?
Adding the
MigrationsTableQuotedconfig broke how theSchemaNameconfig is used.stephane-klein commentedon Apr 20, 2021
@dhui Yes, I can (I think the 2021-04-21 morning).
FAQinghere commentedon Apr 21, 2021
To be fair, I believe that config value was never respected consistently in the Postgres driver, going back years. The issue was not introduced by the latest changes. I’m pretty sure that a couple of years ago on some project I simply made it use that config value and suddenly it all worked fine (no need for the quoted table name handling, etc.).
stephane-klein commentedon Apr 21, 2021
Some notes:
Config.SchemaNameis only used byLock()andUnlock()functions.Config.SchemaNamewas introduced in this commit.Work In Progress golang-migrate#547
postgres,pgx: fix SchemaName parameter is ignored #golang-migrate#547
postgres,pgx: fix SchemaName parameter is ignored #golang-migrate#547
postgres,pgx: fix SchemaName parameter is ignored #golang-migrate#547
jeffwidman commentedon May 12, 2021
Was this issue fixed by #550?
dhui commentedon May 13, 2021
@jeffwidman yep, this is fixed by #550