Skip to content

schema config parameter has no effect with pg driver (postgres) #459

Open
@stefaneg

Description

@stefaneg

I trying to get db-migrate to create the migration table in a schema of my choosing, to no avail. After a brief look through the code, it seems to me that the schema attribute in database.json is never used. If I understand the code correctly, the config object is passed directly to the node-postgres driver, which does nothing with the schema attribute.

This issue here is possibly relevant, it basically states that schema specification through config is not supported.

brianc/node-postgres#1123

Am I missing something?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

pedro-ribeiro

pedro-ribeiro commented on Apr 5, 2017

@pedro-ribeiro

Same problem here.

wzrdtales

wzrdtales commented on Apr 9, 2017

@wzrdtales
Member

@pedro-ribeiro @stefaneg Ok, seems like this needs a bit of hoop jumping to make it work with pg. Thanks for reporting!

LiamKarlMitchell

LiamKarlMitchell commented on Nov 3, 2017

@LiamKarlMitchell

Could we have a post connect query executed for set options?

Other database/scenarios may also benefit from running some set options to configure the session some way before any other sql commands are executed.
(ANSI NULLS SQL server etc if someone ever made a connector for that)

Example:

-- on connect
set search_path = <schema>, public;

Providing the user/role has the appropriate grants on that schema?

Note: Ended up just making multiple users with different configured search paths to work around this.

oaltman

oaltman commented on Apr 4, 2018

@oaltman

any update on this?

Koofii

Koofii commented on Nov 14, 2018

@Koofii

Any update on this?

davetheninja

davetheninja commented on Oct 4, 2019

@davetheninja

All can someone confirm if this was ever fixed?

I am using the latest beta and am getting the same issue.

If it has been fixed and it’s now a regression can someone tell me which version to roll back to please.

kylecombes

kylecombes commented on Sep 22, 2021

@kylecombes

I'm still seeing this problem.

nstylo

nstylo commented on Dec 21, 2023

@nstylo

Still seeing this issue. Not sure if this ever will be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @davetheninja@stefaneg@pedro-ribeiro@wzrdtales@LiamKarlMitchell

        Issue actions

          schema config parameter has no effect with pg driver (postgres) · Issue #459 · db-migrate/node-db-migrate