Npgsql 10.0.1
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
Npgsql.EntityFrameworkCore.PostgreSQL
|
16 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
15 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
16 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
17 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
18 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
20 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
24 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
25 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
28 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
30 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
53 |
|
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
|
15 |
|
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
|
16 |
|
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
|
17 |
.NET 8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 9.0.11)
.NET 9.0
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
.NET 10.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 10.0.1 | 4 | 19.12.2025 |
| 10.0.0 | 7 | 25.11.2025 |
| 10.0.0-rc.1 | 9 | 25.10.2025 |
| 9.0.4 | 6 | 23.10.2025 |
| 9.0.3 | 34 | 14.03.2025 |
| 9.0.2 | 39 | 22.12.2024 |
| 9.0.1 | 23 | 26.11.2024 |
| 8.0.8 | 7 | 23.10.2025 |
| 8.0.7 | 14 | 14.03.2025 |
| 8.0.6 | 15 | 14.03.2025 |
| 8.0.5 | 19 | 19.10.2024 |
| 8.0.4 | 23 | 28.09.2024 |
| 8.0.3 | 24 | 13.05.2024 |
| 8.0.2 | 19 | 27.01.2025 |
| 8.0.1 | 14 | 22.08.2024 |
| 8.0.0 | 17 | 19.02.2025 |
| 8.0.0-rc.2 | 12 | 15.03.2025 |
| 8.0.0-preview.4 | 19 | 09.01.2025 |
| 8.0.0-preview.3 | 18 | 14.01.2025 |
| 8.0.0-preview.2 | 16 | 09.01.2025 |
| 8.0.0-preview.1 | 16 | 09.01.2025 |
| 7.0.10 | 16 | 22.04.2025 |
| 7.0.9 | 16 | 30.01.2025 |
| 7.0.8 | 16 | 23.01.2025 |
| 7.0.7 | 16 | 16.01.2025 |
| 7.0.6 | 15 | 30.01.2025 |
| 7.0.4 | 16 | 15.01.2025 |
| 7.0.2 | 16 | 18.07.2024 |
| 7.0.1 | 12 | 14.03.2025 |
| 7.0.0 | 17 | 24.01.2025 |
| 7.0.0-rc.2 | 13 | 22.08.2024 |
| 7.0.0-rc.1 | 15 | 27.01.2025 |
| 7.0.0-preview.7 | 17 | 15.01.2025 |
| 7.0.0-preview.6 | 15 | 11.01.2025 |
| 7.0.0-preview.5 | 16 | 09.01.2025 |
| 7.0.0-preview.4 | 17 | 09.01.2025 |
| 7.0.0-preview.3 | 16 | 12.01.2025 |
| 7.0.0-preview.2 | 14 | 09.01.2025 |
| 7.0.0-preview.1 | 14 | 29.07.2024 |
| 6.0.13 | 17 | 15.01.2025 |
| 6.0.12 | 17 | 24.01.2025 |
| 6.0.11 | 12 | 22.08.2024 |
| 6.0.10 | 14 | 18.02.2025 |
| 6.0.9 | 14 | 30.01.2025 |
| 6.0.8 | 13 | 30.01.2025 |
| 6.0.7 | 12 | 14.03.2025 |
| 6.0.6 | 15 | 27.07.2024 |
| 6.0.5 | 15 | 30.01.2025 |
| 6.0.4 | 11 | 14.03.2025 |
| 6.0.3 | 13 | 27.07.2024 |
| 6.0.2 | 15 | 18.02.2025 |
| 6.0.1 | 18 | 27.07.2024 |
| 6.0.0 | 13 | 18.02.2025 |
| 6.0.0-rc.2 | 15 | 18.02.2025 |
| 6.0.0-rc.1 | 14 | 30.01.2025 |
| 6.0.0-preview7 | 12 | 30.01.2025 |
| 6.0.0-preview6 | 18 | 22.08.2024 |
| 6.0.0-preview5 | 18 | 16.01.2025 |
| 6.0.0-preview4 | 15 | 11.01.2025 |
| 6.0.0-preview3 | 13 | 16.01.2025 |
| 6.0.0-preview2 | 18 | 11.01.2025 |
| 5.0.18 | 16 | 08.11.2024 |
| 5.0.17 | 16 | 30.01.2025 |
| 5.0.16 | 12 | 14.03.2025 |
| 5.0.15 | 17 | 14.01.2025 |
| 5.0.14 | 19 | 18.02.2025 |
| 5.0.13 | 15 | 23.01.2025 |
| 5.0.12 | 21 | 15.01.2025 |
| 5.0.11 | 15 | 24.01.2025 |
| 5.0.10 | 17 | 24.12.2024 |
| 5.0.7 | 15 | 14.03.2025 |
| 5.0.5 | 12 | 14.03.2025 |
| 5.0.4 | 12 | 14.03.2025 |
| 5.0.3 | 14 | 23.01.2025 |
| 5.0.2 | 19 | 24.12.2024 |
| 5.0.1.1 | 19 | 31.01.2025 |
| 5.0.0 | 11 | 14.03.2025 |
| 4.1.14 | 14 | 27.07.2024 |
| 4.1.13 | 12 | 14.03.2025 |
| 4.1.12 | 19 | 24.09.2024 |
| 4.1.11 | 18 | 29.07.2024 |
| 4.1.10 | 15 | 14.01.2025 |
| 4.1.9 | 14 | 16.01.2025 |
| 4.1.8 | 16 | 18.02.2025 |
| 4.1.7 | 14 | 18.02.2025 |
| 4.1.6 | 15 | 18.02.2025 |
| 4.1.5 | 15 | 18.02.2025 |
| 4.1.4 | 14 | 14.03.2025 |
| 4.1.3.1 | 16 | 15.01.2025 |
| 4.1.3 | 19 | 18.02.2025 |
| 4.1.2 | 18 | 23.01.2025 |
| 4.1.1 | 17 | 15.01.2025 |
| 4.1.0 | 17 | 18.02.2025 |
| 4.0.17 | 15 | 30.01.2025 |
| 4.0.16 | 15 | 23.01.2025 |
| 4.0.14 | 16 | 29.01.2025 |
| 4.0.13 | 15 | 18.02.2025 |
| 4.0.12 | 18 | 18.02.2025 |
| 4.0.11 | 12 | 18.02.2025 |
| 4.0.10 | 24 | 27.07.2024 |
| 4.0.9 | 14 | 14.03.2025 |
| 4.0.8 | 16 | 19.02.2025 |
| 4.0.7 | 15 | 23.01.2025 |
| 4.0.6 | 14 | 31.01.2025 |
| 4.0.5 | 15 | 24.01.2025 |
| 4.0.4 | 18 | 17.02.2025 |
| 4.0.3 | 15 | 30.01.2025 |
| 4.0.2 | 17 | 30.08.2024 |
| 4.0.1 | 12 | 29.07.2024 |
| 4.0.0 | 14 | 17.02.2025 |
| 4.0.0-rc1 | 15 | 18.02.2025 |
| 4.0.0-preview2 | 13 | 11.01.2025 |
| 4.0.0-preview1 | 18 | 18.02.2025 |
| 3.2.7 | 13 | 02.02.2025 |
| 3.2.6 | 16 | 27.07.2024 |
| 3.2.5 | 16 | 18.02.2025 |
| 3.2.4.1 | 15 | 18.02.2025 |
| 3.2.4 | 13 | 14.03.2025 |
| 3.2.3 | 16 | 18.02.2025 |
| 3.2.2 | 14 | 22.08.2024 |
| 3.2.1 | 16 | 18.02.2025 |
| 3.2.0 | 18 | 27.07.2024 |
| 3.1.10 | 16 | 30.01.2025 |
| 3.1.9 | 15 | 15.01.2025 |
| 3.1.8 | 13 | 19.02.2025 |
| 3.1.7 | 15 | 30.01.2025 |
| 3.1.6 | 14 | 19.02.2025 |
| 3.1.5 | 15 | 15.01.2025 |
| 3.1.4 | 15 | 14.03.2025 |
| 3.1.3 | 15 | 18.02.2025 |
| 3.1.2 | 14 | 18.02.2025 |
| 3.1.1 | 16 | 27.07.2024 |
| 3.1.0 | 15 | 14.03.2025 |
| 3.0.8 | 14 | 05.02.2025 |
| 3.0.7 | 14 | 18.02.2025 |
| 3.0.6 | 16 | 27.07.2024 |
| 3.0.5 | 15 | 18.02.2025 |
| 3.0.4 | 14 | 19.02.2025 |
| 3.0.3 | 14 | 30.01.2025 |
| 3.0.2 | 13 | 11.10.2024 |
| 3.0.1 | 14 | 18.02.2025 |
| 3.0.0 | 16 | 01.08.2024 |
| 2.2.7 | 15 | 18.02.2025 |
| 2.2.6 | 18 | 27.07.2024 |
| 2.2.5 | 16 | 14.03.2025 |
| 2.2.4.3 | 15 | 18.02.2025 |
| 2.2.4.1 | 11 | 27.07.2024 |
| 2.2.3 | 13 | 14.03.2025 |
| 2.2.2 | 14 | 18.02.2025 |
| 2.2.1 | 15 | 24.01.2025 |
| 2.2.0 | 10 | 14.03.2025 |
| 2.1.3 | 15 | 16.01.2025 |
| 2.1.2 | 16 | 17.02.2025 |
| 2.1.1 | 17 | 18.02.2025 |
| 2.1.0 | 13 | 14.03.2025 |
| 2.0.14.3 | 12 | 14.03.2025 |
| 2.0.12.1 | 16 | 17.01.2025 |
| 2.0.11 | 14 | 29.01.2025 |