Npgsql 7.0.0-preview.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
TestContainers
Package Description
63
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
51
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
50
Marten
Postgresql as a Document Db and Event Store for .Net Development
50
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
45
TestContainers
Package Description
45
Marten
Postgresql as a Document Db and Event Store for .Net Development
44
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
43
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
42
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
41
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
40
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
39
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
38
Marten
Postgresql as a Document Db and Event Store for .Net Development
38

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