Npgsql 10.0.0-rc.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.

Showing the top 20 packages that depend on Npgsql.

Packages Downloads
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
83
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
84
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
99
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
116
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
136
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
158
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
173
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
194
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
319
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
330
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
345
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
83
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
86
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
93
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
120
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
179
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
217
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
603

.NET 8.0

.NET 9.0

Version Downloads Last updated
10.0.0-rc.1 11 10/06/2025
9.0.4 12 10/06/2025
9.0.3 162 03/27/2025
9.0.2 55 12/07/2024
9.0.1 56 11/19/2024
9.0.0 52 11/19/2024
8.0.8 9 10/06/2025
8.0.7 43 04/02/2025
8.0.6 41 11/23/2024
8.0.5 66 10/21/2024
8.0.4 50 10/07/2024
8.0.3 102 06/27/2024
8.0.2 67 07/22/2024
8.0.1 83 02/04/2024
8.0.0 153 02/04/2024
8.0.0-rc.2 63 07/22/2024
8.0.0-preview.4 68 07/22/2024
8.0.0-preview.3 67 07/22/2024
8.0.0-preview.2 76 07/22/2024
8.0.0-preview.1 68 07/22/2024
7.0.10 51 04/02/2025
7.0.9 52 11/19/2024
7.0.8 49 10/08/2024
7.0.7 69 07/22/2024
7.0.6 73 07/22/2024
7.0.4 82 07/22/2024
7.0.2 130 02/04/2024
7.0.1 69 07/22/2024
7.0.0 84 02/04/2024
7.0.0-rc.2 73 07/22/2024
7.0.0-rc.1 58 07/22/2024
7.0.0-preview.7 72 07/22/2024
7.0.0-preview.6 74 07/22/2024
7.0.0-preview.5 74 07/22/2024
7.0.0-preview.4 73 07/22/2024
7.0.0-preview.3 69 07/22/2024
7.0.0-preview.2 67 07/22/2024
7.0.0-preview.1 63 07/22/2024
6.0.13 41 11/19/2024
6.0.12 56 10/08/2024
6.0.11 70 07/22/2024
6.0.10 67 07/22/2024
6.0.9 70 07/22/2024
6.0.8 67 07/22/2024
6.0.7 76 07/22/2024
6.0.6 78 07/22/2024
6.0.5 76 07/22/2024
6.0.4 98 02/09/2024
6.0.3 102 02/04/2024
6.0.2 77 07/22/2024
6.0.1 70 07/22/2024
6.0.0 82 07/22/2024
6.0.0-rc.2 77 07/22/2024
6.0.0-rc.1 64 07/22/2024
6.0.0-preview7 84 07/22/2024
6.0.0-preview6 67 07/22/2024
6.0.0-preview5 71 07/22/2024
6.0.0-preview4 67 07/22/2024
6.0.0-preview3 72 07/22/2024
6.0.0-preview2 76 07/22/2024
5.0.18 81 07/22/2024
5.0.17 84 07/22/2024
5.0.16 78 07/22/2024
5.0.15 79 07/22/2024
5.0.14 81 07/22/2024
5.0.13 81 07/20/2024
5.0.12 72 07/22/2024
5.0.11 70 07/22/2024
5.0.10 67 07/22/2024
5.0.7 79 07/21/2024
5.0.5 206 02/04/2024
5.0.4 77 07/22/2024
5.0.3 72 07/22/2024
5.0.2 80 07/22/2024
5.0.1.1 67 07/22/2024
5.0.0 69 07/22/2024
4.1.14 71 07/22/2024
4.1.13 84 07/22/2024
4.1.12 73 07/22/2024
4.1.11 81 07/22/2024
4.1.10 79 07/21/2024
4.1.9 69 07/22/2024
4.1.8 66 07/22/2024
4.1.7 70 07/22/2024
4.1.6 82 07/22/2024
4.1.5 73 07/22/2024
4.1.4 66 07/22/2024
4.1.3.1 89 07/22/2024
4.1.3 64 07/22/2024
4.1.2 72 07/22/2024
4.1.1 68 07/22/2024
4.1.0 77 07/22/2024
4.0.17 120 07/22/2024
4.0.16 93 07/22/2024
4.0.14 73 07/22/2024
4.0.13 70 07/22/2024
4.0.12 73 07/22/2024
4.0.11 80 07/22/2024
4.0.10 81 07/22/2024
4.0.9 80 07/22/2024
4.0.8 79 07/22/2024
4.0.7 76 07/22/2024
4.0.6 78 07/22/2024
4.0.5 67 07/22/2024
4.0.4 74 07/22/2024
4.0.3 75 07/22/2024
4.0.2 82 07/22/2024
4.0.1 66 07/22/2024
4.0.0 68 07/22/2024
4.0.0-rc1 74 07/22/2024
4.0.0-preview2 71 07/22/2024
4.0.0-preview1 77 07/22/2024
3.2.7 67 07/22/2024
3.2.6 78 07/22/2024
3.2.5 81 07/22/2024
3.2.4.1 68 07/22/2024
3.2.4 77 07/22/2024
3.2.3 78 07/22/2024
3.2.2 71 07/22/2024
3.2.1 77 07/22/2024
3.2.0 68 07/22/2024
3.1.10 68 07/22/2024
3.1.9 73 07/22/2024
3.1.8 67 07/22/2024
3.1.7 71 07/22/2024
3.1.6 69 07/22/2024
3.1.5 76 07/22/2024
3.1.4 70 07/22/2024
3.1.3 77 07/22/2024
3.1.2 63 07/22/2024
3.1.1 76 07/22/2024
3.1.0 61 07/22/2024
3.0.8 63 07/22/2024
3.0.7 72 07/22/2024
3.0.6 82 07/22/2024
3.0.5 79 07/22/2024
3.0.4 81 07/22/2024
3.0.3 76 07/22/2024
3.0.2 80 07/22/2024
3.0.1 68 07/22/2024
3.0.0 75 07/22/2024
2.2.7 77 07/22/2024
2.2.6 79 07/22/2024
2.2.5 86 07/22/2024
2.2.4.3 71 07/22/2024
2.2.4.1 74 07/22/2024
2.2.3 74 07/22/2024
2.2.2 63 07/22/2024
2.2.1 85 07/22/2024
2.2.0 73 07/22/2024
2.1.3 74 07/22/2024
2.1.2 85 07/22/2024
2.1.1 74 07/22/2024
2.1.0 77 07/22/2024
2.0.14.3 72 07/22/2024
2.0.12.1 82 07/22/2024
2.0.11 62 07/22/2024