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.
47
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
48
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
49
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
66
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
67
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
76
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
81
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
98
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
101
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
239
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
265
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
48
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
49
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
56
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
61
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
115
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
337

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