Npgsql 9.0.3
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.
|
62 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
63 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
64 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
83 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
91 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
111 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
112 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
148 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
155 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
298 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
305 |
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
64 |
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
65 |
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
76 |
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
89 |
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
131 |
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
155 |
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
|
489 |
.NET 6.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Text.Json (>= 8.0.5)
.NET 8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
Version | Downloads | Last updated |
---|---|---|
9.0.3 | 83 | 03/27/2025 |
9.0.2 | 32 | 12/07/2024 |
9.0.1 | 33 | 11/19/2024 |
9.0.0 | 28 | 11/19/2024 |
8.0.7 | 27 | 04/02/2025 |
8.0.6 | 23 | 11/23/2024 |
8.0.5 | 41 | 10/21/2024 |
8.0.4 | 30 | 10/07/2024 |
8.0.3 | 84 | 06/27/2024 |
8.0.2 | 47 | 07/22/2024 |
8.0.1 | 64 | 02/04/2024 |
8.0.0 | 131 | 02/04/2024 |
8.0.0-rc.2 | 44 | 07/22/2024 |
8.0.0-preview.4 | 49 | 07/22/2024 |
8.0.0-preview.3 | 49 | 07/22/2024 |
8.0.0-preview.2 | 49 | 07/22/2024 |
8.0.0-preview.1 | 45 | 07/22/2024 |
7.0.10 | 30 | 04/02/2025 |
7.0.9 | 33 | 11/19/2024 |
7.0.8 | 29 | 10/08/2024 |
7.0.7 | 50 | 07/22/2024 |
7.0.6 | 51 | 07/22/2024 |
7.0.4 | 67 | 07/22/2024 |
7.0.2 | 111 | 02/04/2024 |
7.0.1 | 51 | 07/22/2024 |
7.0.0 | 66 | 02/04/2024 |
7.0.0-rc.2 | 53 | 07/22/2024 |
7.0.0-rc.1 | 40 | 07/22/2024 |
7.0.0-preview.7 | 52 | 07/22/2024 |
7.0.0-preview.6 | 55 | 07/22/2024 |
7.0.0-preview.5 | 53 | 07/22/2024 |
7.0.0-preview.4 | 54 | 07/22/2024 |
7.0.0-preview.3 | 49 | 07/22/2024 |
7.0.0-preview.2 | 49 | 07/22/2024 |
7.0.0-preview.1 | 48 | 07/22/2024 |
6.0.13 | 25 | 11/19/2024 |
6.0.12 | 38 | 10/08/2024 |
6.0.11 | 51 | 07/22/2024 |
6.0.10 | 47 | 07/22/2024 |
6.0.9 | 51 | 07/22/2024 |
6.0.8 | 47 | 07/22/2024 |
6.0.7 | 58 | 07/22/2024 |
6.0.6 | 55 | 07/22/2024 |
6.0.5 | 56 | 07/22/2024 |
6.0.4 | 82 | 02/09/2024 |
6.0.3 | 86 | 02/04/2024 |
6.0.2 | 55 | 07/22/2024 |
6.0.1 | 49 | 07/22/2024 |
6.0.0 | 59 | 07/22/2024 |
6.0.0-rc.2 | 55 | 07/22/2024 |
6.0.0-rc.1 | 43 | 07/22/2024 |
6.0.0-preview7 | 64 | 07/22/2024 |
6.0.0-preview6 | 48 | 07/22/2024 |
6.0.0-preview5 | 53 | 07/22/2024 |
6.0.0-preview4 | 50 | 07/22/2024 |
6.0.0-preview3 | 50 | 07/22/2024 |
6.0.0-preview2 | 55 | 07/22/2024 |
5.0.18 | 58 | 07/22/2024 |
5.0.17 | 61 | 07/22/2024 |
5.0.16 | 59 | 07/22/2024 |
5.0.15 | 55 | 07/22/2024 |
5.0.14 | 58 | 07/22/2024 |
5.0.13 | 62 | 07/20/2024 |
5.0.12 | 55 | 07/22/2024 |
5.0.11 | 47 | 07/22/2024 |
5.0.10 | 46 | 07/22/2024 |
5.0.7 | 54 | 07/21/2024 |
5.0.5 | 172 | 02/04/2024 |
5.0.4 | 54 | 07/22/2024 |
5.0.3 | 53 | 07/22/2024 |
5.0.2 | 58 | 07/22/2024 |
5.0.1.1 | 50 | 07/22/2024 |
5.0.0 | 48 | 07/22/2024 |
4.1.14 | 49 | 07/22/2024 |
4.1.13 | 65 | 07/22/2024 |
4.1.12 | 51 | 07/22/2024 |
4.1.11 | 62 | 07/22/2024 |
4.1.10 | 61 | 07/21/2024 |
4.1.9 | 47 | 07/22/2024 |
4.1.8 | 45 | 07/22/2024 |
4.1.7 | 50 | 07/22/2024 |
4.1.6 | 62 | 07/22/2024 |
4.1.5 | 51 | 07/22/2024 |
4.1.4 | 56 | 07/22/2024 |
4.1.3.1 | 65 | 07/22/2024 |
4.1.3 | 43 | 07/22/2024 |
4.1.2 | 57 | 07/22/2024 |
4.1.1 | 51 | 07/22/2024 |
4.1.0 | 54 | 07/22/2024 |
4.0.17 | 89 | 07/22/2024 |
4.0.16 | 73 | 07/22/2024 |
4.0.14 | 53 | 07/22/2024 |
4.0.13 | 53 | 07/22/2024 |
4.0.12 | 48 | 07/22/2024 |
4.0.11 | 56 | 07/22/2024 |
4.0.10 | 59 | 07/22/2024 |
4.0.9 | 59 | 07/22/2024 |
4.0.8 | 59 | 07/22/2024 |
4.0.7 | 56 | 07/22/2024 |
4.0.6 | 57 | 07/22/2024 |
4.0.5 | 47 | 07/22/2024 |
4.0.4 | 53 | 07/22/2024 |
4.0.3 | 55 | 07/22/2024 |
4.0.2 | 62 | 07/22/2024 |
4.0.1 | 44 | 07/22/2024 |
4.0.0 | 50 | 07/22/2024 |
4.0.0-rc1 | 56 | 07/22/2024 |
4.0.0-preview2 | 49 | 07/22/2024 |
4.0.0-preview1 | 55 | 07/22/2024 |
3.2.7 | 49 | 07/22/2024 |
3.2.6 | 58 | 07/22/2024 |
3.2.5 | 58 | 07/22/2024 |
3.2.4.1 | 46 | 07/22/2024 |
3.2.4 | 59 | 07/22/2024 |
3.2.3 | 59 | 07/22/2024 |
3.2.2 | 53 | 07/22/2024 |
3.2.1 | 58 | 07/22/2024 |
3.2.0 | 50 | 07/22/2024 |
3.1.10 | 50 | 07/22/2024 |
3.1.9 | 56 | 07/22/2024 |
3.1.8 | 47 | 07/22/2024 |
3.1.7 | 48 | 07/22/2024 |
3.1.6 | 49 | 07/22/2024 |
3.1.5 | 56 | 07/22/2024 |
3.1.4 | 50 | 07/22/2024 |
3.1.3 | 54 | 07/22/2024 |
3.1.2 | 45 | 07/22/2024 |
3.1.1 | 56 | 07/22/2024 |
3.1.0 | 39 | 07/22/2024 |
3.0.8 | 49 | 07/22/2024 |
3.0.7 | 55 | 07/22/2024 |
3.0.6 | 59 | 07/22/2024 |
3.0.5 | 59 | 07/22/2024 |
3.0.4 | 63 | 07/22/2024 |
3.0.3 | 57 | 07/22/2024 |
3.0.2 | 56 | 07/22/2024 |
3.0.1 | 49 | 07/22/2024 |
3.0.0 | 54 | 07/22/2024 |
2.2.7 | 60 | 07/22/2024 |
2.2.6 | 58 | 07/22/2024 |
2.2.5 | 63 | 07/22/2024 |
2.2.4.3 | 52 | 07/22/2024 |
2.2.4.1 | 55 | 07/22/2024 |
2.2.3 | 58 | 07/22/2024 |
2.2.2 | 41 | 07/22/2024 |
2.2.1 | 60 | 07/22/2024 |
2.2.0 | 58 | 07/22/2024 |
2.1.3 | 52 | 07/22/2024 |
2.1.2 | 63 | 07/22/2024 |
2.1.1 | 56 | 07/22/2024 |
2.1.0 | 58 | 07/22/2024 |
2.0.14.3 | 54 | 07/22/2024 |
2.0.12.1 | 58 | 07/22/2024 |
2.0.11 | 44 | 07/22/2024 |