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.
58
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
59
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
78
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
86
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
90
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
93
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
97
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
108
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
135
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
266
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
295
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
58
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
59
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.
75
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
87
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
144
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
438

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