Best practice for PostgreSQL
Introduction This is a work-in-progress. Reader discretion is adviced! Client library Use the newest Npgsql library - ref documentation for nuget package and recommended use. Make sure to use NpgsqlDataSource that was introduced in Npgsql 7.0. Configure npgsql with DI as described here (missing in the standard docs at the time of writing). Commands (Npgsql) Do not concatenate User-Defined types as strings into the SQL commands. (SQL injection preventation) Parameters Use parameters instead of embedding values in the SQL. »