Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Subject: Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs
Date: 2023-07-07 17:42:57
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:

> This gives me several "-Wincompatible-pointer-types" warnings
> [...]
> I think what you probably ought to do to avoid all that is to change
> the arguments of PrintQueryResult and nearby routines to be "const
> PGresult *result" not just "PGresult *result".

The const-ness issue that I ignored in the previous patch is that
while C is fine with passing T* to a function expecting const T*, it's
not okay with passing T** to a function expecting const T**,
or more generally converting T** to const T**.

When callers need to pass arrays of PGresult* instead of const
PGresult*, I've opted to remove the const qualifiers for the functions
that are concerned by this change.

PFA an updated patch.

Best regards,
Daniel Vérité
Twitter: @DanielVerite

Attachment Content-Type Size
psql-fetchcount-single-row-mode-v3.diff text/x-patch 12.2 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2023-07-07 17:44:53 Re: [17] CREATE COLLATION default provider
Previous Message Matthias van de Meent 2023-07-07 17:12:31 Re: HOT readme missing documentation on summarizing index handling