Npgsql 6.0.9
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
- The Entity Framework Core provider that works with this provider is Npgsql.EntityFrameworkCore.PostgreSQL.
- Spatial plugin to work with PostgreSQL PostGIS: Npgsql.NetTopologySuite
- NodaTime plugin to use better date/time types with PostgreSQL: Npgsql.NodaTime
- OpenTelemetry support can be set up with Npgsql.OpenTelemetry
Showing the top 20 packages that depend on Npgsql.
| Packages | Downloads |
|---|---|
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
102 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
103 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
106 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
118 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
136 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
151 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
190 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
214 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
356 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
373 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
466 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
103 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
104 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
115 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
150 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
199 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
258 |
|
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
|
649 |
.NET Core 3.1
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
.NET Standard 2.1
- System.Threading.Channels (>= 6.0.0)
- System.Text.Json (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Collections.Immutable (>= 6.0.0)
.NET Standard 2.0
- System.Threading.Channels (>= 6.0.0)
- System.Text.Json (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Collections.Immutable (>= 6.0.0)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
.NET 6.0
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
.NET 5.0
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 10.0.0 | 2 | 11/23/2025 |
| 10.0.0-rc.1 | 30 | 10/06/2025 |
| 9.0.4 | 37 | 10/06/2025 |
| 9.0.3 | 200 | 03/27/2025 |
| 9.0.2 | 77 | 12/07/2024 |
| 9.0.1 | 75 | 11/19/2024 |
| 9.0.0 | 69 | 11/19/2024 |
| 8.0.8 | 24 | 10/06/2025 |
| 8.0.7 | 59 | 04/02/2025 |
| 8.0.6 | 59 | 11/23/2024 |
| 8.0.5 | 92 | 10/21/2024 |
| 8.0.4 | 68 | 10/07/2024 |
| 8.0.3 | 121 | 06/27/2024 |
| 8.0.2 | 84 | 07/22/2024 |
| 8.0.1 | 104 | 02/04/2024 |
| 8.0.0 | 172 | 02/04/2024 |
| 8.0.0-rc.2 | 89 | 07/22/2024 |
| 8.0.0-preview.4 | 89 | 07/22/2024 |
| 8.0.0-preview.3 | 87 | 07/22/2024 |
| 8.0.0-preview.2 | 96 | 07/22/2024 |
| 8.0.0-preview.1 | 92 | 07/22/2024 |
| 7.0.10 | 72 | 04/02/2025 |
| 7.0.9 | 70 | 11/19/2024 |
| 7.0.8 | 73 | 10/08/2024 |
| 7.0.7 | 85 | 07/22/2024 |
| 7.0.6 | 85 | 07/22/2024 |
| 7.0.4 | 104 | 07/22/2024 |
| 7.0.2 | 156 | 02/04/2024 |
| 7.0.1 | 86 | 07/22/2024 |
| 7.0.0 | 104 | 02/04/2024 |
| 7.0.0-rc.2 | 90 | 07/22/2024 |
| 7.0.0-rc.1 | 72 | 07/22/2024 |
| 7.0.0-preview.7 | 92 | 07/22/2024 |
| 7.0.0-preview.6 | 89 | 07/22/2024 |
| 7.0.0-preview.5 | 93 | 07/22/2024 |
| 7.0.0-preview.4 | 89 | 07/22/2024 |
| 7.0.0-preview.3 | 90 | 07/22/2024 |
| 7.0.0-preview.2 | 86 | 07/22/2024 |
| 7.0.0-preview.1 | 82 | 07/22/2024 |
| 6.0.13 | 63 | 11/19/2024 |
| 6.0.12 | 75 | 10/08/2024 |
| 6.0.11 | 91 | 07/22/2024 |
| 6.0.10 | 87 | 07/22/2024 |
| 6.0.9 | 88 | 07/22/2024 |
| 6.0.8 | 85 | 07/22/2024 |
| 6.0.7 | 97 | 07/22/2024 |
| 6.0.6 | 94 | 07/22/2024 |
| 6.0.5 | 98 | 07/22/2024 |
| 6.0.4 | 120 | 02/09/2024 |
| 6.0.3 | 123 | 02/04/2024 |
| 6.0.2 | 95 | 07/22/2024 |
| 6.0.1 | 92 | 07/22/2024 |
| 6.0.0 | 93 | 07/22/2024 |
| 6.0.0-rc.2 | 93 | 07/22/2024 |
| 6.0.0-rc.1 | 77 | 07/22/2024 |
| 6.0.0-preview7 | 99 | 07/22/2024 |
| 6.0.0-preview6 | 91 | 07/22/2024 |
| 6.0.0-preview5 | 95 | 07/22/2024 |
| 6.0.0-preview4 | 88 | 07/22/2024 |
| 6.0.0-preview3 | 91 | 07/22/2024 |
| 6.0.0-preview2 | 97 | 07/22/2024 |
| 5.0.18 | 98 | 07/22/2024 |
| 5.0.17 | 106 | 07/22/2024 |
| 5.0.16 | 99 | 07/22/2024 |
| 5.0.15 | 94 | 07/22/2024 |
| 5.0.14 | 103 | 07/22/2024 |
| 5.0.13 | 102 | 07/20/2024 |
| 5.0.12 | 96 | 07/22/2024 |
| 5.0.11 | 93 | 07/22/2024 |
| 5.0.10 | 91 | 07/22/2024 |
| 5.0.7 | 95 | 07/21/2024 |
| 5.0.5 | 229 | 02/04/2024 |
| 5.0.4 | 99 | 07/22/2024 |
| 5.0.3 | 96 | 07/22/2024 |
| 5.0.2 | 100 | 07/22/2024 |
| 5.0.1.1 | 87 | 07/22/2024 |
| 5.0.0 | 92 | 07/22/2024 |
| 4.1.14 | 86 | 07/22/2024 |
| 4.1.13 | 103 | 07/22/2024 |
| 4.1.12 | 91 | 07/22/2024 |
| 4.1.11 | 102 | 07/22/2024 |
| 4.1.10 | 96 | 07/21/2024 |
| 4.1.9 | 92 | 07/22/2024 |
| 4.1.8 | 86 | 07/22/2024 |
| 4.1.7 | 90 | 07/22/2024 |
| 4.1.6 | 99 | 07/22/2024 |
| 4.1.5 | 93 | 07/22/2024 |
| 4.1.4 | 84 | 07/22/2024 |
| 4.1.3.1 | 108 | 07/22/2024 |
| 4.1.3 | 83 | 07/22/2024 |
| 4.1.2 | 90 | 07/22/2024 |
| 4.1.1 | 85 | 07/22/2024 |
| 4.1.0 | 96 | 07/22/2024 |
| 4.0.17 | 148 | 07/22/2024 |
| 4.0.16 | 113 | 07/22/2024 |
| 4.0.14 | 93 | 07/22/2024 |
| 4.0.13 | 84 | 07/22/2024 |
| 4.0.12 | 86 | 07/22/2024 |
| 4.0.11 | 100 | 07/22/2024 |
| 4.0.10 | 95 | 07/22/2024 |
| 4.0.9 | 99 | 07/22/2024 |
| 4.0.8 | 100 | 07/22/2024 |
| 4.0.7 | 92 | 07/22/2024 |
| 4.0.6 | 103 | 07/22/2024 |
| 4.0.5 | 85 | 07/22/2024 |
| 4.0.4 | 91 | 07/22/2024 |
| 4.0.3 | 96 | 07/22/2024 |
| 4.0.2 | 102 | 07/22/2024 |
| 4.0.1 | 84 | 07/22/2024 |
| 4.0.0 | 87 | 07/22/2024 |
| 4.0.0-rc1 | 100 | 07/22/2024 |
| 4.0.0-preview2 | 86 | 07/22/2024 |
| 4.0.0-preview1 | 93 | 07/22/2024 |
| 3.2.7 | 84 | 07/22/2024 |
| 3.2.6 | 92 | 07/22/2024 |
| 3.2.5 | 96 | 07/22/2024 |
| 3.2.4.1 | 86 | 07/22/2024 |
| 3.2.4 | 91 | 07/22/2024 |
| 3.2.3 | 89 | 07/22/2024 |
| 3.2.2 | 93 | 07/22/2024 |
| 3.2.1 | 95 | 07/22/2024 |
| 3.2.0 | 91 | 07/22/2024 |
| 3.1.10 | 86 | 07/22/2024 |
| 3.1.9 | 92 | 07/22/2024 |
| 3.1.8 | 83 | 07/22/2024 |
| 3.1.7 | 92 | 07/22/2024 |
| 3.1.6 | 84 | 07/22/2024 |
| 3.1.5 | 93 | 07/22/2024 |
| 3.1.4 | 86 | 07/22/2024 |
| 3.1.3 | 92 | 07/22/2024 |
| 3.1.2 | 79 | 07/22/2024 |
| 3.1.1 | 89 | 07/22/2024 |
| 3.1.0 | 84 | 07/22/2024 |
| 3.0.8 | 76 | 07/22/2024 |
| 3.0.7 | 89 | 07/22/2024 |
| 3.0.6 | 105 | 07/22/2024 |
| 3.0.5 | 104 | 07/22/2024 |
| 3.0.4 | 98 | 07/22/2024 |
| 3.0.3 | 92 | 07/22/2024 |
| 3.0.2 | 106 | 07/22/2024 |
| 3.0.1 | 87 | 07/22/2024 |
| 3.0.0 | 92 | 07/22/2024 |
| 2.2.7 | 103 | 07/22/2024 |
| 2.2.6 | 98 | 07/22/2024 |
| 2.2.5 | 105 | 07/22/2024 |
| 2.2.4.3 | 91 | 07/22/2024 |
| 2.2.4.1 | 97 | 07/22/2024 |
| 2.2.3 | 90 | 07/22/2024 |
| 2.2.2 | 80 | 07/22/2024 |
| 2.2.1 | 106 | 07/22/2024 |
| 2.2.0 | 91 | 07/22/2024 |
| 2.1.3 | 96 | 07/22/2024 |
| 2.1.2 | 103 | 07/22/2024 |
| 2.1.1 | 94 | 07/22/2024 |
| 2.1.0 | 101 | 07/22/2024 |
| 2.0.14.3 | 88 | 07/22/2024 |
| 2.0.12.1 | 93 | 07/22/2024 |
| 2.0.11 | 82 | 07/22/2024 |