Skip to content

Fixed database on EntityFramework connection #278

Closed

Description

@mateusaubin

Hi,

I've had a problem where, when using Npgsql.Entityframework, the database parameter of my connectionstring was overriden with the value "postgres".

After debugging I've narrowed the issue to this line on NpgsqlServices.cs.

I really think this is a bug, since it's overriding my configuration as defined on the connectionstring.

Thanks

Activity

  1. DavidKarlas commented on Jul 15, 2014

    @DavidKarlas
    Contributor

    If we want to create new database we must connect to server... If we want to connect to server we must specify existing database... I think(maybe I'm wrong) that "postgres" database is always there... Hence hardcoded value...

    Notice that method UsingPostgresDBConnection is used just when creating/droping... databases... So all data operations are done on database you specified..

    I'm not sure what problem do you have... "postgres" database doesn't exist on server or something else?

  2. mateusaubin commented on Jul 15, 2014

    @mateusaubin
    Author

    Now I see, thanks.

    The problem here is that I am connecting to Amazon Redshift, hence the "postgres" database doesn't exists.

    I've already made a fix to my local version and it's working fine.

    I will close this issue, thanks once again.

  3. franciscojunior commented on Jul 16, 2014

    @franciscojunior
    Member

    HI, @mateusaubin ! Thanks for your feedback. I'd like to hear more about your experience running Npgsql with Amazon Redshift. From your commits Redshift doesn't seem to support some settings we are using. Are those the only problems you faced?

    Thanks in advance.

  4. mateusaubin commented on Jul 17, 2014

    @mateusaubin
    Author

    Some changes were needed since Redshift is quite different from postgres internally.
    The library works quite well after disabling the unsupported features.
    We are using it with standard ADO (NpgsqlConnection and friends) as well as EntityFramework.
    As development progresses and incompatibilities arise we're trying to fix our internal fork of the project, but things progressed really well up to now.
    If you guys want I could create a pull request to merge Redshift support (which is currently enabled through a compile constant #if REDSHIFT)

  5. roji commented on Jul 17, 2014

    @roji
    Member

    It would be great if you could share this code. I don't think we would integrate any code with #if REDSHIFT in it, but we could investigate how to integrate the changes into Npgsql in a more streamlined way...

    Note that there's issue #163 already open.

  6. roji commented on Mar 3, 2015

    @roji
    Member

    Note that the UsingPostgresDBConnection issue was fixed in #511

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

      Issue actions