Npgsql 6.0.4 The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved

.NET 5.0 .NET Core 3.1 .NET Standard 2.0
There is a newer prerelease version of this package available.
See the version list below for details.
Install-Package Npgsql -Version 6.0.4
dotnet add package Npgsql --version 6.0.4
<PackageReference Include="Npgsql" Version="6.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Npgsql --version 6.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Npgsql, 6.0.4"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Npgsql as a Cake Addin
#addin nuget:?package=Npgsql&version=6.0.4

// Install Npgsql as a Cake Tool
#tool nuget:?package=Npgsql&version=6.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Npgsql is the open source .NET data provider for PostgreSQL. It allows you to connect and interact with PostgreSQL server using .NET.

Quickstart

Here's a basic code snippet to get you started:

var connString = "Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase";

await using var conn = new NpgsqlConnection(connString);
await conn.OpenAsync();

// Insert some data
await using (var cmd = new NpgsqlCommand("INSERT INTO data (some_field) VALUES (@p)", conn))
{
    cmd.Parameters.AddWithValue("p", "Hello world");
    await cmd.ExecuteNonQueryAsync();
}

// Retrieve all rows
await using (var cmd = new NpgsqlCommand("SELECT some_field FROM data", conn))
await using (var reader = await cmd.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
    Console.WriteLine(reader.GetString(0));
}

Key features

  • High-performance PostgreSQL driver. Regularly figures in the top contenders on the TechEmpower Web Framework Benchmarks.
  • Full support of most PostgreSQL types, including advanced ones such as arrays, enums, ranges, multiranges, composites, JSON, PostGIS and others.
  • Highly-efficient bulk import/export API.
  • Failover, load balancing and general multi-host support.
  • Great integration with Entity Framework Core via Npgsql.EntityFrameworkCore.PostgreSQL.

For the full documentation, please visit the Npgsql website.

Related packages

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1.0K)

Showing the top 5 NuGet packages that depend on Npgsql:

Package Downloads
Npgsql.EntityFrameworkCore.PostgreSQL The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

PostgreSQL/Npgsql provider for Entity Framework Core.

AspNetCore.HealthChecks.NpgSql

HealthChecks.NpgSql is a health check for Postgress Sql.

Npgsql.EntityFrameworkCore.PostgreSQL.Design

PostgreSQL/Npgsql provider for Entity Framework Core.

Hangfire.PostgreSql

PostgreSql storage implementation for Hangfire (background job system for ASP.NET and aspnet core applications).

Npgsql.Json.NET The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.

GitHub repositories (156)

Showing the top 5 popular GitHub repositories that depend on Npgsql:

Repository Stars
DapperLib/Dapper
Dapper - a simple object mapper for .Net
dotnet/orleans
Cloud Native application framework for .NET
nopSolutions/nopCommerce
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
dotnetcore/CAP
Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern
quartznet/quartznet
Quartz Enterprise Scheduler .NET
Version Downloads Last updated
7.0.0-preview.4 3,326 5/11/2022
7.0.0-preview.3 7,557 4/19/2022
7.0.0-preview.2 10,472 3/16/2022
7.0.0-preview.1 128,918 2/17/2022
6.0.4 687,870 4/19/2022
6.0.3 2,396,824 1/27/2022
6.0.2 1,588,019 12/20/2021
6.0.1 1,220,164 12/3/2021
6.0.0 1,497,085 11/9/2021
6.0.0-rc.2 103,351 10/14/2021
6.0.0-rc.1 30,336 9/24/2021
6.0.0-preview7 21,889 8/16/2021
6.0.0-preview6 7,032 7/31/2021
6.0.0-preview5 20,459 7/1/2021
6.0.0-preview4 48,183 5/27/2021
6.0.0-preview3 49,567 4/15/2021
6.0.0-preview2 39,589 3/11/2021
5.0.13 36,501 4/26/2022
5.0.12 212,572 2/1/2022
5.0.11 543,632 11/12/2021
5.0.10 4,304,512 9/15/2021
5.0.7 5,302,650 6/13/2021
5.0.5 2,218,563 5/11/2021
5.0.4 2,871,649 3/25/2021
5.0.3 3,610,379 1/26/2021
5.0.2 3,177,436 1/19/2021
5.0.1.1 1,779,576 12/12/2020
5.0.0 2,802,339 11/15/2020
4.1.11 13,589 4/26/2022
4.1.10 187,362 11/12/2021
4.1.9 1,089,761 4/6/2021
4.1.8 2,047,759 1/21/2021
4.1.7 334,464 12/12/2020
4.1.6 659,379 11/15/2020
4.1.5 2,047,621 9/28/2020
4.1.4 2,714,051 7/19/2020
4.1.3.1 13,065,169 2/20/2020
4.1.3 5,825,093 1/31/2020
4.1.2 3,959,099 11/14/2019
4.1.1 2,435,883 10/2/2019
4.1.0 462,428 9/26/2019
4.0.12 47,989 5/16/2021
4.0.11 148,531 7/19/2020
4.0.10 3,723,809 9/9/2019
4.0.9 862,186 8/14/2019
4.0.8 711,427 7/18/2019
4.0.7 5,370,600 5/21/2019
4.0.6 2,603,334 4/11/2019
4.0.5 1,015,135 3/3/2019
4.0.4 5,970,047 12/6/2018
4.0.3 4,815,368 9/8/2018
4.0.2 2,535,529 7/8/2018
4.0.1 667,885 7/1/2018
4.0.0 1,460,278 5/30/2018
4.0.0-rc1 65,348 5/8/2018
4.0.0-preview2 66,801 4/11/2018
4.0.0-preview1 15,628 3/19/2018
3.2.7 2,998,589 2/27/2018
3.2.6 4,174,047 12/3/2017
3.2.5 4,331,756 7/25/2017
3.2.4.1 204,608 6/22/2017
3.2.4 21,510 6/13/2017
3.2.3 54,694 6/1/2017
3.2.2 1,429,362 3/21/2017
3.2.1 98,870 2/14/2017
3.2.0 52,276 1/27/2017
3.1.10 62,260 2/14/2017
3.1.9 2,425,151 11/20/2016
3.1.8 289,323 9/24/2016
3.1.7 284,674 8/6/2016
3.1.6 90,010 7/12/2016
3.1.5 215,629 6/28/2016
3.1.4 62,551 6/16/2016
3.1.3 256,915 5/30/2016
3.1.2 56,497 5/22/2016
3.1.1 151,826 5/19/2016
3.1.0 83,223 5/16/2016
3.0.8 25,437 6/16/2016
3.0.7 23,401 5/3/2016
3.0.6 5,734 5/1/2016
3.0.5 196,403 1/1/2016
3.0.4 23,899 12/6/2015
3.0.3 53,140 9/27/2015
3.0.2 18,842 9/4/2015
3.0.1 26,564 8/18/2015
3.0.0 26,531 8/7/2015
2.2.7 302,264 9/18/2015
2.2.6 18,851 8/27/2015
2.2.5 268,969 3/11/2015
2.2.4.3 28,308 2/6/2015
2.2.4.1 10,994 2/3/2015
2.2.3 235,655 11/26/2014
2.2.2 20,825 11/1/2014
2.2.1 42,210 9/24/2014
2.2.0 19,400 9/1/2014
2.1.3 51,631 4/9/2014
2.1.2 11,534 3/28/2014
2.1.1 13,613 3/21/2014
2.1.0 15,596 3/19/2014
2.0.14.3 64,845 12/21/2013
2.0.12.1 57,669 12/17/2012
2.0.11 104,146 2/6/2011