Re: Figure out nullability of query parameters

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Giacomo Cavalieri <giacomo(dot)cavalieri(at)icloud(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Figure out nullability of query parameters
Date: 2025-06-27 14:52:56
Message-ID: CAKFQuwaBXfo1LaUWYkPtZaTOaeua6b2SDmX=PtB0r9cvcNYd+w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday, June 27, 2025, Giacomo Cavalieri <giacomo(dot)cavalieri(at)icloud(dot)com>
wrote:

>
> It would be really handy to know that `$1` is being used as a non nullable
> value, while `$2` could actually be null. Can this already be achieve
> today, or would there be a way to surface this kind of information for
> query parameters in the extended protocol?
>

There is no attempt in the system to try and pass constraint information
through the query planner and expose it to the client. It doesn’t seem
like there is sufficient utility to try and do so. The fact that it pretty
much only works in the exact query form you’ve shown here is part of that.
Not sure we’d turn it down but someone will need to step up and scratch
their own itch in all likelihood (the request for similar functionality in
the result comes up too).

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Sabino Mullane 2025-06-27 15:15:26 Re: Figure out nullability of query parameters
Previous Message Petr Kada 2025-06-27 14:45:02 Re: Figure out nullability of query parameters