Like most ADO.NET providers, Npgsql uses the connection pool by default. When you Close() an NpgsqlConnection object, the internal object representing the actual underlying connection that uses Npgsql goes into the pool that needs to be reused, saving the extra cost of creating another one unnecessarily. (See What does “opening a connection” really mean? For more).
This is suitable for most applications, since it usually takes several times to use the connection within a second.
This doesn't suit you at all, but if you include the Pooling=false option in the connection string, it will override this default value, and Close() will really close the actual connection.
source share