Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9254233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:24:58+00:00 2026-06-18T11:24:58+00:00

I am attempting to set up my application to use Entity Framework with PostgreSQL,

  • 0

I am attempting to set up my application to use Entity Framework with PostgreSQL, but I have run up against a problem. I have added Npqsql via nuget, and added the following provider factory to web.config:

<system.data>
    <DbProviderFactories>
        <add name="Npgsql Data Provider" 
           invariant="Npgsql" 
           description=".Net Framework Data Provider for Postgresql Server" 
           type="Npgsql.NpgsqlFactory, Npgsql, 
                 Version=2.0.12.0, Culture=neutral, 
                 PublicKeyToken=5d8b90d52f46fda7" />
    </DbProviderFactories>
  </system.data>

With the connection string:

    <add name="MyDb" providerName="Npgsql" 
connectionString="Server=localhost;Port=5432;Database=withoomph;User ID=postgres;Password=******;enlist=true" />

It seems to connect to the DB fine, but when I try and do any sort of action on the DB I get the following exception:

FATAL: 3D000: database "withoomph" does not exist

I am setting the database intitializer correctly when the db is set up like so:

static MyDB()
{
    Database.SetInitializer<MyDB>(new CreateDatabaseIfNotExists<MyDB>());
}

So it should just simply create db when I try and do anything with my DbContext right? I don’t get it, been pulling my hair out all morning!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:24:59+00:00Added an answer on June 18, 2026 at 11:24 am

    Unfortunately, Npgsql does not have (as of now) automatic schema creation code-first.

    You can create your database first, and then connect to it.

    Update (2016): Npgsql 3 now implements database creation code-first. Make sure you configure the correct connection factory to use NpgsqlConnections, either via code or via the XML settings, and use an appropriate Connection String.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to use the Exhibit pattern in a padrino application but to
I have a Zend Framework modular application set up. One of my modules is
I'm attempting to use jqGrid in my ASP.Net MVC application and have a requirement
I'm attempting to set up the Laravel PHP Framework to work with Nginx .
I am attempting to run the following command in KornShell (ksh): set -A INDEXES
I'm attempting to use Dapper to return a set of Shares and an associated
I am attempting to use java scanner with the following set of delimiters &
I'm attempting to use the rest-client gem to post something, but for some reason,
I am attempting to develop an application that makes use of some simple trig
I have an application that makes use of the Mozilla LDAP library. We're diagnosing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.