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.

Showing the top 20 packages that depend on Npgsql.

Packages Downloads
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
68
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
69
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
88
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
99
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
117
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
122
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
123
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
163
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
171
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
305
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
312
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
68
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
71
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
81
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
94
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
143
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
159
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
500

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