Npgsql 9.0.1

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.DependencyInjection
Package Description
1
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
1

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