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.

Showing the top 20 packages that depend on Npgsql.

Packages Downloads
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
143
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
145
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
146
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
150
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
152
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
155
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
180
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
189
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
243
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
246
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
278
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
387
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
414
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
706
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
181
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
228
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
347
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
148
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
793

Version Downloads Last updated
10.0.2 15 03/13/2026
10.0.1 51 12/19/2025
10.0.0 100 11/23/2025
10.0.0-rc.1 80 10/06/2025
9.0.5 10 03/14/2026
9.0.4 73 10/06/2025
9.0.3 289 03/27/2025
9.0.2 144 12/07/2024
9.0.1 130 11/19/2024
9.0.0 109 11/19/2024
8.0.9 8 03/14/2026
8.0.8 57 10/06/2025
8.0.7 84 04/02/2025
8.0.6 95 11/23/2024
8.0.5 142 10/21/2024
8.0.4 104 10/07/2024
8.0.3 153 06/27/2024
8.0.2 125 07/22/2024
8.0.1 147 02/04/2024
8.0.0 221 02/04/2024
8.0.0-rc.2 129 07/22/2024
8.0.0-preview.4 124 07/22/2024
8.0.0-preview.3 131 07/22/2024
8.0.0-preview.2 134 07/22/2024
8.0.0-preview.1 136 07/22/2024
7.0.10 102 04/02/2025
7.0.9 112 11/19/2024
7.0.8 103 10/08/2024
7.0.7 117 07/22/2024
7.0.6 113 07/22/2024
7.0.4 145 07/22/2024
7.0.2 195 02/04/2024
7.0.1 113 07/22/2024
7.0.0 146 02/04/2024
7.0.0-rc.2 128 07/22/2024
7.0.0-rc.1 104 07/22/2024
7.0.0-preview.7 125 07/22/2024
7.0.0-preview.6 134 07/22/2024
7.0.0-preview.5 141 07/22/2024
7.0.0-preview.4 131 07/22/2024
7.0.0-preview.3 134 07/22/2024
7.0.0-preview.2 128 07/22/2024
7.0.0-preview.1 137 07/22/2024
6.0.13 103 11/19/2024
6.0.12 119 10/08/2024
6.0.11 142 07/22/2024
6.0.10 119 07/22/2024
6.0.9 131 07/22/2024
6.0.8 130 07/22/2024
6.0.7 141 07/22/2024
6.0.6 118 07/22/2024
6.0.5 136 07/22/2024
6.0.4 172 02/09/2024
6.0.3 161 02/04/2024
6.0.2 159 07/22/2024
6.0.1 120 07/22/2024
6.0.0 145 07/22/2024
6.0.0-rc.2 129 07/22/2024
6.0.0-rc.1 118 07/22/2024
6.0.0-preview7 128 07/22/2024
6.0.0-preview6 132 07/22/2024
6.0.0-preview5 146 07/22/2024
6.0.0-preview4 134 07/22/2024
6.0.0-preview3 131 07/22/2024
6.0.0-preview2 131 07/22/2024
5.0.18 139 07/22/2024
5.0.17 140 07/22/2024
5.0.16 138 07/22/2024
5.0.15 124 07/22/2024
5.0.14 163 07/22/2024
5.0.13 146 07/20/2024
5.0.12 122 07/22/2024
5.0.11 124 07/22/2024
5.0.10 121 07/22/2024
5.0.7 147 07/21/2024
5.0.5 281 02/04/2024
5.0.4 132 07/22/2024
5.0.3 144 07/22/2024
5.0.2 157 07/22/2024
5.0.1.1 130 07/22/2024
5.0.0 123 07/22/2024
4.1.14 123 07/22/2024
4.1.13 135 07/22/2024
4.1.12 140 07/22/2024
4.1.11 137 07/22/2024
4.1.10 139 07/21/2024
4.1.9 136 07/22/2024
4.1.8 119 07/22/2024
4.1.7 139 07/22/2024
4.1.6 129 07/22/2024
4.1.5 120 07/22/2024
4.1.4 129 07/22/2024
4.1.3.1 152 07/22/2024
4.1.3 125 07/22/2024
4.1.2 148 07/22/2024
4.1.1 125 07/22/2024
4.1.0 137 07/22/2024
4.0.17 219 07/22/2024
4.0.16 143 07/22/2024
4.0.14 127 07/22/2024
4.0.13 119 07/22/2024
4.0.12 125 07/22/2024
4.0.11 129 07/22/2024
4.0.10 139 07/22/2024
4.0.9 140 07/22/2024
4.0.8 146 07/22/2024
4.0.7 128 07/22/2024
4.0.6 139 07/22/2024
4.0.5 118 07/22/2024
4.0.4 127 07/22/2024
4.0.3 135 07/22/2024
4.0.2 152 07/22/2024
4.0.1 132 07/22/2024
4.0.0 116 07/22/2024
4.0.0-rc1 145 07/22/2024
4.0.0-preview2 133 07/22/2024
4.0.0-preview1 133 07/22/2024
3.2.7 124 07/22/2024
3.2.6 127 07/22/2024
3.2.5 139 07/22/2024
3.2.4.1 131 07/22/2024
3.2.4 125 07/22/2024
3.2.3 122 07/22/2024
3.2.2 129 07/22/2024
3.2.1 142 07/22/2024
3.2.0 147 07/22/2024
3.1.10 114 07/22/2024
3.1.9 141 07/22/2024
3.1.8 121 07/22/2024
3.1.7 135 07/22/2024
3.1.6 126 07/22/2024
3.1.5 128 07/22/2024
3.1.4 125 07/22/2024
3.1.3 134 07/22/2024
3.1.2 132 07/22/2024
3.1.1 128 07/22/2024
3.1.0 133 07/22/2024
3.0.8 116 07/22/2024
3.0.7 144 07/22/2024
3.0.6 134 07/22/2024
3.0.5 136 07/22/2024
3.0.4 137 07/22/2024
3.0.3 129 07/22/2024
3.0.2 150 07/22/2024
3.0.1 140 07/22/2024
3.0.0 137 07/22/2024
2.2.7 138 07/22/2024
2.2.6 133 07/22/2024
2.2.5 162 07/22/2024
2.2.4.3 134 07/22/2024
2.2.4.1 149 07/22/2024
2.2.3 134 07/22/2024
2.2.2 150 07/22/2024
2.2.1 152 07/22/2024
2.2.0 135 07/22/2024
2.1.3 126 07/22/2024
2.1.2 133 07/22/2024
2.1.1 136 07/22/2024
2.1.0 137 07/22/2024
2.0.14.3 128 07/22/2024
2.0.12.1 119 07/22/2024
2.0.11 126 07/22/2024