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.
140
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
141
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
148
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
177
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
182
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
235
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
236
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
264
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
381
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
404
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
689
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
137
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
138
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
140
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
180
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
225
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
344
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
142
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
775

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