Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uVA6X-00EYuS-RI for pgsql-general@arkaria.postgresql.org; Fri, 27 Jun 2025 14:31:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uVA6V-002KIM-TF for pgsql-general@arkaria.postgresql.org; Fri, 27 Jun 2025 14:31:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uVA6V-002KHL-Ht for pgsql-general@lists.postgresql.org; Fri, 27 Jun 2025 14:31:00 +0000 Received: from p-east3-cluster1-host3-snip4-5.eps.apple.com ([57.103.87.28] helo=outbound.qs.icloud.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uVA6T-004Q12-2o for pgsql-general@lists.postgresql.org; Fri, 27 Jun 2025 14:30:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=t5qY/0MVEPQODQgP/AoRmAsUlCeoZ7CcUfdoBQkLxwU=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To:x-icloud-hme; b=GhR6+A5Z4iaWVcWDgtI5MtEqvbzBOMHeaBwLyu4u/7T0PURLnHBQWUuKMTNHwEL1J IjmjIf38jnbSj9T1a6NufMbL6wa/vymO5moMoFKg62qmpS6F6N0fPJjQAxBpl05la4 wzVTb3RSV9yj/cpveJHp3fKgrlSxQrbIyDbjAXnQel8lmPm8cyYMQoPbcZ5p56VW3Q mUhGjS9cSuHYmZNi1XbIsMljBiCMwpapO17BSbF7krxS//5If8bIo7VgaoZdxKP3qn p1B2iFH/z8sBBe8uONID1n2bY3X8XXbxb84rtlgoDiO3FtZXiIm5PA0DkCKtALIAAB pwUSVu+j9VjUg== Received: from outbound.qs.icloud.com (unknown [127.0.0.2]) by outbound.qs.icloud.com (Postfix) with ESMTPS id 08716180019F for ; Fri, 27 Jun 2025 14:30:54 +0000 (UTC) Received: from smtpclient.apple (qs-asmtp-me-k8s.p00.prod.me.com [17.57.155.37]) by outbound.qs.icloud.com (Postfix) with ESMTPSA id 1203D18000B3 for ; Fri, 27 Jun 2025 14:30:53 +0000 (UTC) From: Giacomo Cavalieri Content-Type: multipart/alternative; boundary="Apple-Mail=_1407EBC6-6206-4C9E-A394-561BE6AE82B2" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Figure out nullability of query parameters Message-Id: <4915B05B-90B6-4CC2-86E7-EF7C1E2E38C9@icloud.com> Date: Fri, 27 Jun 2025 16:30:41 +0200 To: pgsql-general@lists.postgresql.org X-Mailer: Apple Mail (2.3826.600.51.1.1) X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjI3MDExOSBTYWx0ZWRfX/BzYa8UrWreK 7y+F7aXpV2ca95OeLmpKBUqbravbTXtFelzRjpgZy7SWxVgcju/z3YxApIDo/NO8eTGmEBPgCDe XPCdpdsSnfMPS6S1sDZlQVze8YFlUhNakD97tVc6ItUVMhaUd/+RSrPytbTF8iFyCie1006d9LK 2HE2QZB2joAgRtcDw2wOUvwpA4A4UYPAt4eFY/tXeaPzqhD+SDD/U3zoFugybaSZZPhhvYb+DSE tfFJ5I9Boo0OEES98uY/q9KVQH5audlQRXpvI+vUlle4wszorRYf0GPEdrlj1QhwD5lul94u8= X-Proofpoint-GUID: jmGAcX-AUu_7PFJ4reWF7cZDLvjRjUr_ X-Proofpoint-ORIG-GUID: jmGAcX-AUu_7PFJ4reWF7cZDLvjRjUr_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-06-27_04,2025-06-26_05,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 mlxlogscore=908 phishscore=0 clxscore=1031 spamscore=0 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506060001 definitions=main-2506270119 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_1407EBC6-6206-4C9E-A394-561BE6AE82B2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello! I=E2=80=99m Giacomo, I=E2=80=99m the maintainer of = , a tool that can generate = type safe bindings to run and decode the results of Postgres queries. It = does that by implementing the extended query protocol, which, among = other things, returns the OIDs of the query parameters=E2=80=99 types. This is really handy and has worked great so far but I=E2=80=99m running = into some rough edges when it comes to the nullability of query = parameters. Take a query like this one: ``` insert into some_table(not_null_col, nullable_column) values ($1, $2) ``` 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? Sorry if this is not the proper list, I=E2=80=99m very new to all of = this :) Thanks! Giacomo= --Apple-Mail=_1407EBC6-6206-4C9E-A394-561BE6AE82B2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hello!
I=E2=80=99m Giacomo, I=E2=80=99m the = maintainer of <https://github.com/g= iacomocavalieri/squirrel>, a tool that can generate type = safe bindings to run and decode the results of Postgres queries. It does = that by implementing the extended query protocol, which, among other = things, returns the OIDs of the query parameters=E2=80=99 = types.
This is really handy and has worked great so far but = I=E2=80=99m running into some rough edges when it comes to the = nullability of query parameters.

Take a query = like this one:
```
insert into = some_table(not_null_col, nullable_column)
values ($1, = $2)
```
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?

Sorry if this is not the proper list, = I=E2=80=99m very new to all of this = :)
Thanks!

Giacomo
= --Apple-Mail=_1407EBC6-6206-4C9E-A394-561BE6AE82B2--