Skip to content

Possibly undocumented breaking change: ExecuteScalarAsync now returns null instead of DBNull.Value #5467

@madelson

Description

@madelson

Steps to reproduce

See madelson/DistributedLock#174. Essentially, use the DistributedLock.Postgres package and then upgrade to Npgsql 8.

The issue

We are issuing a command like this:

SET LOCAL statement_timeout = 0;
SET LOCAL lock_timeout = 0;

SELECT pg_catalog.pg_advisory_lock(@key) AS result

Retrieving the result with ExecuteScalarAsync(). Previously this would return DBNull.Value when pg_advisory_lock returned null, but as of 8.0 it seems to return DBNull.Value instead.

My brief scan of the breaking change documentation didn't turn up anything about this, so I decided to report. Apologies if I missed it!

Further technical details

Npgsql version: 8.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions