Re: Doc: section "8.21. Pseudo-Types" needs a bit of clarification?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Doc: section "8.21. Pseudo-Types" needs a bit of clarification?
Date: 2025-05-27 18:30:55
Message-ID: CAKFQuwaDZbRszFLmC1V7qsSc1MAETYXodbg25EjSWv=wMs9-Gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 27, 2025 at 11:15 AM Aleksander Alekseev <
aleksander(at)timescale(dot)com> wrote:

> While reading our documentation about pseudo-types [1] I noticed that it
> says:
>
> """
> anyelement - Indicates that a function accepts any data type
> anyarray - Indicates that a function accepts any array data type
> """
>
> This may give an impression that anyelement and anyarray can be used
> as an argument ("accepted") but not as a return value, while in fact
> they can. In particular we have [2]:
>
> Should we be slightly more precise here?
>

I'm fine with the status quo for these. The table entry points out the
pertinent part - that they must be used on at least one input argument.
The various texts both in 8.21 and 36.2 describing usage and overall
behavior make it clear they can appear also on the return type clause so
long as they also appear in the input arguments. The functions themselves
morph strictly upon the types used in the input arguments.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-05-27 18:38:19 Tightening DecodeNumberField's parsing rules
Previous Message Andres Freund 2025-05-27 18:21:30 Re: Non-reproducible AIO failure