Npgsql

.NET Data Provider for PostgreSQL

About Npgsql

Npgsql is the .NET data provider for PostgreSQL. It allows any program developed for .NET framework to access a PostgreSQL database server. It is implemented in 100% C# code. PostgreSQL versions since 9.0 are officially supported, others may work. Read more...

Latest News

  • Npgsql 3.0.7 is out

    Npgsql 3.0.7 is out and available at nuget.org.

    This release undoes change #946, which made it illegal to start parameter names with digits. While this fixed an SQL parsing issue, it causes too much breakage for ORMs and existing code which uses parameter names such as @1. An alternative fix, #1056, has been applied instead in 3.0.7 - you can use parameter names with digits as before.

  • Npgsql Entity Framework Core available for rc2

    Npgsql’s Entity Framework Core (previously EF7) provider has been synced up with EFCore rc2.

    The package has been renamed Npgsql.EntityFrameworkCore.PostgreSQL and is available in the Npgsql unstable feed. Continuous integration is set up (mostly) and will ensure that as development continues new packages will be available.

    Please report any issues you find on https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL.

  • Npgsql 3.0.6 is out

    Npgsql 3.0.6 is out and available at nuget.org.

    This release fixes numerous bugs, including one that could cause pooled connections to “leak” under certain load conditions (#1019). Thanks to @shortspider for raising and fixing the issue.

    An additional issue related to Npgsql’s internal query parser was fixed (#946). Note that as a result, parameter names can no longer start with a digit - this could cause breakage if you were using parameter names such as :1.

    Is is strongly recommended that everyone upgrade. The full list of changes is available here.

  • Porting to dotnet RC2 and Restructuring

    After three months of inactivity due to a super-intensive project, I’m back to life. Here is some info on some work done on the project.

    Npgsql has been ported to the latest dotnet RC2 bits and compiles with the dotnet CLI (no more DNX).

    The Entity Framework Core provider (previously EF7) is being moved into its own repository. There are several reasons for this change:

    • The general instability of EFCore caused frequent build issues which interfered with unrelated work on Npgsql.
    • The EFCore provider and Npgsql are very loosely-coupled, there’s no real reason for them to coexist in the same repo.
    • The EFCore provider needs to follow its own release and versioning rhythm. Since we use gitversion, all projects within the same git repo follow the same versioning; note how the EF6 provider was “released” every time Npgsql was released, even if no EF6 change happened.
    • There’s no reason to run all Npgsql tests if an EF7-only change occurs, this needlessly slows down our build in continuous integration.
    • Ability to give people permissions to the EFCore project only, etc.

    Note that the EF Core provider hasn’t been ported to RC2 yet and is in a broken state, I will get around to this soon. Note also that a similar decoupling of the EF6 provider into its own repo will probably happen soon as well.

    Finally, Npgsql also uses a complex process to rewrite synchronous methods into async counterparts, using a package called AsyncRewriter. This process frequently broke down and caused issues for people trying to build the project, and slowed down the build as well. As of now the resulting GeneratedAsync.cs is committed into git, so building should be much easier. You still can (and occasionally must) trigger AsyncRewriter by dropping down to shell and executing dotnet rewrite-async.

    The following weeks will be dedicated to working on Npgsql itself and getting to a 3.1 beta ASAP.

    Please let me know about any issues you run into!

  • Npgsql 3.0.5 is out

    Npgsql 3.0.5 is out and available at nuget.org.

    This release that could affect users setting MinPoolSize > 1. See issue #918.

    Also, when closing a pooled connection that had an active transaction, that transaction would not be rolled back immediately. This could cause issues and has been fixed - transactions are rolled back immediately upon close. See issue #927.

    Note that NpgsqlConnection’s DataSource property now returns a URL (e.g. tcp://localhost:5432). Code that relied on the contents of DataSource is probably now broken. See issue #903.

    Npgsql 2.2 had a Windows installer that would set up Npgsql in the GAC and update your machine.config file - this installer has been revived and will now be released with 3.x version (check our releases tab on Github. Note that in most use cases, Npgsql should not be installed into the GAC - use Nuget instead. See the installation page for more details.

    Is is strongly recommended that everyone upgrade. The full list of changes is available here.

    Happy new year 2016!

Click here for older announcements