Re: proposal: new polymorphic types - commontype and commontypearray

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, David Steele <david(at)pgmasters(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: new polymorphic types - commontype and commontypearray
Date: 2020-03-14 14:16:42
Message-ID: CAFj8pRBT1dxSzxJJwJxZb_V2K=yOTSRMz20KFd18zO=Rdno_yg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

so 14. 3. 2020 v 14:26 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> > pá 13. 3. 2020 v 23:42 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:
> >> The reason that this might be controversial is that it forces a slightly
> >> less precise error detail message to be issued, since the call site
> that's
> >> throwing the error doesn't know exactly which rule was being violated.
> >> (For example, before there was a specific error message about anyrange
> >> result requiring an anyrange input, and now there isn't.)
>
> > Unfortunately the error message " A function returning "anyrange" must
> have
> > at least one "anyrange" argument." will be missing.
>
> Yeah, that's what I said. But does it really add anything beyond the
> proposed text "A function returning a polymorphic type must have at least
> one matching polymorphic argument"? I don't think it'd be terribly
> helpful to say "A function returning anyelement must have at least one
> anyelement, anyarray, anynonarray, anyenum, or anyrange argument", and
> for sure such an error message would be a pain to maintain.
>

The error message in your first patch is ok for all types without anyrange.
A behave of this type is more strict and +/- different than from other
polymorphic types.

Pavel

> regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Atsushi Torikoshi 2020-03-14 15:06:12 Re: RecoveryWalAll and RecoveryWalStream wait events
Previous Message Amit Kapila 2020-03-14 14:09:43 Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager