ADO.NET drivers for PostgreSQL

Unofficial Content
This documentation is valid for:

This article states what drivers can be or are used to connect to PostgreSQL from .NET and .NET Core applications, and the benefits of each option.

Using the .NET Generator, as of GeneXus 17 upgrade 3, npgsql.dll 3.2.7 is being distributed and used by default. If you need to keep using npgsql 1.0.0, you need to obtain and copy the following to your installation:

  • npgsql.dll version 1.0.0.0
  • Mono.Security.dll version 1.0.0.0

Using the .NET Core Generator, npgsql.dll 3.2.7 is used.

Comparing versions

  Problems Benefits
npgsql 1.0
  • Does not support PostgreSQL 13   
  • Supports multiple data readers (Less memory consumption loading recordsets from the database (*))

 

npgsql 3.x or higher
  • Higher memory consumption loading recordsets from the database (*)
  • Supports PostgreSQL 11 or higher (including PostgreSQL 13)
  • Supports Auto-prepare to improve performance (**)

(*) The driver does not support multiple server cursors reading data at the same time. Therefore, when you nest reads, all data of the outer cursor has to be read first and loaded to memory, and then the nested cursor can start executing. More information at Performance and memory implications depending Drivers support for multiple data readers.

(**) Auto-Prepare: Higher Performance
Version 3.2.7 or higher supports auto-prepare (https://www.npgsql.org/doc/prepare.html).
To enable this feature, you must add 'Max Auto Prepare=N' to the Additional connection string attributes property.
 

See Also