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.
161
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
162
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
165
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
167
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
169
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
195
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
199
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
260
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
264
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
303
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
403
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
431
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
754
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
160
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
197
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
242
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
363
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
160
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
878

Version Downloads Last updated
10.0.3 4 05/27/2026
10.0.2 47 03/13/2026
10.0.1 79 12/19/2025
10.0.0 168 11/23/2025
10.0.0-rc.1 100 10/06/2025
9.0.5 31 03/14/2026
9.0.4 99 10/06/2025
9.0.3 310 03/27/2025
9.0.2 159 12/07/2024
9.0.1 152 11/19/2024
9.0.0 125 11/19/2024
8.0.9 34 03/14/2026
8.0.8 80 10/06/2025
8.0.7 109 04/02/2025
8.0.6 121 11/23/2024
8.0.5 165 10/21/2024
8.0.4 128 10/07/2024
8.0.3 180 06/27/2024
8.0.2 147 07/22/2024
8.0.1 172 02/04/2024
8.0.0 241 02/04/2024
8.0.0-rc.2 153 07/22/2024
8.0.0-preview.4 143 07/22/2024
8.0.0-preview.3 156 07/22/2024
8.0.0-preview.2 158 07/22/2024
8.0.0-preview.1 154 07/22/2024
7.0.10 122 04/02/2025
7.0.9 134 11/19/2024
7.0.8 120 10/08/2024
7.0.7 131 07/22/2024
7.0.6 125 07/22/2024
7.0.4 164 07/22/2024
7.0.2 213 02/04/2024
7.0.1 129 07/22/2024
7.0.0 158 02/04/2024
7.0.0-rc.2 145 07/22/2024
7.0.0-rc.1 121 07/22/2024
7.0.0-preview.7 139 07/22/2024
7.0.0-preview.6 150 07/22/2024
7.0.0-preview.5 155 07/22/2024
7.0.0-preview.4 141 07/22/2024
7.0.0-preview.3 148 07/22/2024
7.0.0-preview.2 142 07/22/2024
7.0.0-preview.1 158 07/22/2024
6.0.13 124 11/19/2024
6.0.12 140 10/08/2024
6.0.11 159 07/22/2024
6.0.10 139 07/22/2024
6.0.9 152 07/22/2024
6.0.8 152 07/22/2024
6.0.7 164 07/22/2024
6.0.6 140 07/22/2024
6.0.5 158 07/22/2024
6.0.4 192 02/09/2024
6.0.3 181 02/04/2024
6.0.2 185 07/22/2024
6.0.1 143 07/22/2024
6.0.0 162 07/22/2024
6.0.0-rc.2 149 07/22/2024
6.0.0-rc.1 137 07/22/2024
6.0.0-preview7 142 07/22/2024
6.0.0-preview6 148 07/22/2024
6.0.0-preview5 162 07/22/2024
6.0.0-preview4 149 07/22/2024
6.0.0-preview3 148 07/22/2024
6.0.0-preview2 143 07/22/2024
5.0.18 155 07/22/2024
5.0.17 156 07/22/2024
5.0.16 154 07/22/2024
5.0.15 149 07/22/2024
5.0.14 179 07/22/2024
5.0.13 164 07/20/2024
5.0.12 142 07/22/2024
5.0.11 146 07/22/2024
5.0.10 142 07/22/2024
5.0.7 161 07/21/2024
5.0.5 311 02/04/2024
5.0.4 155 07/22/2024
5.0.3 160 07/22/2024
5.0.2 182 07/22/2024
5.0.1.1 149 07/22/2024
5.0.0 140 07/22/2024
4.1.14 140 07/22/2024
4.1.13 155 07/22/2024
4.1.12 160 07/22/2024
4.1.11 159 07/22/2024
4.1.10 158 07/21/2024
4.1.9 157 07/22/2024
4.1.8 140 07/22/2024
4.1.7 156 07/22/2024
4.1.6 143 07/22/2024
4.1.5 145 07/22/2024
4.1.4 146 07/22/2024
4.1.3.1 171 07/22/2024
4.1.3 149 07/22/2024
4.1.2 170 07/22/2024
4.1.1 140 07/22/2024
4.1.0 167 07/22/2024
4.0.17 245 07/22/2024
4.0.16 162 07/22/2024
4.0.14 144 07/22/2024
4.0.13 143 07/22/2024
4.0.12 143 07/22/2024
4.0.11 153 07/22/2024
4.0.10 161 07/22/2024
4.0.9 167 07/22/2024
4.0.8 165 07/22/2024
4.0.7 151 07/22/2024
4.0.6 160 07/22/2024
4.0.5 136 07/22/2024
4.0.4 145 07/22/2024
4.0.3 158 07/22/2024
4.0.2 176 07/22/2024
4.0.1 152 07/22/2024
4.0.0 137 07/22/2024
4.0.0-rc1 167 07/22/2024
4.0.0-preview2 152 07/22/2024
4.0.0-preview1 149 07/22/2024
3.2.7 148 07/22/2024
3.2.6 144 07/22/2024
3.2.5 153 07/22/2024
3.2.4.1 149 07/22/2024
3.2.4 144 07/22/2024
3.2.3 131 07/22/2024
3.2.2 156 07/22/2024
3.2.1 164 07/22/2024
3.2.0 162 07/22/2024
3.1.10 131 07/22/2024
3.1.9 159 07/22/2024
3.1.8 142 07/22/2024
3.1.7 151 07/22/2024
3.1.6 144 07/22/2024
3.1.5 143 07/22/2024
3.1.4 137 07/22/2024
3.1.3 151 07/22/2024
3.1.2 153 07/22/2024
3.1.1 143 07/22/2024
3.1.0 155 07/22/2024
3.0.8 134 07/22/2024
3.0.7 161 07/22/2024
3.0.6 152 07/22/2024
3.0.5 154 07/22/2024
3.0.4 159 07/22/2024
3.0.3 153 07/22/2024
3.0.2 167 07/22/2024
3.0.1 159 07/22/2024
3.0.0 157 07/22/2024
2.2.7 152 07/22/2024
2.2.6 158 07/22/2024
2.2.5 176 07/22/2024
2.2.4.3 159 07/22/2024
2.2.4.1 169 07/22/2024
2.2.3 159 07/22/2024
2.2.2 177 07/22/2024
2.2.1 179 07/22/2024
2.2.0 159 07/22/2024
2.1.3 137 07/22/2024
2.1.2 147 07/22/2024
2.1.1 155 07/22/2024
2.1.0 159 07/22/2024
2.0.14.3 144 07/22/2024
2.0.12.1 137 07/22/2024
2.0.11 147 07/22/2024