pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Declare lead() and lag() using anycompatible not anyelement.
Date: Wed, 04 Nov 2020 20:08:48 +0000
Message-ID: <E1kaP5M-0005So-77@gemulon.postgresql.org> (raw)

Declare lead() and lag() using anycompatible not anyelement.

This allows use of a "default" expression that doesn't slavishly
match the data column's type.  Formerly you got something like
"function lag(numeric, integer, integer) does not exist", which
is not just unhelpful but actively misleading.

The SQL spec suggests that the default should be coerced to the data
column's type, but this implementation instead chooses the common
supertype, which seems at least as reasonable.

(Note: I took the opportunity to run "make reformat-dat-files" on
pg_proc.dat, so this commit includes some cosmetic changes to
recently-added entries that aren't related to lead/lag.)

Vik Fearing

Discussion: https://postgr.es/m/77675130-89da-dab1-51dd-492c93dcf5d1@postgresfriends.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5c292e6b90433c760a3e15027646c7b94afd0cdd

Modified Files
--------------
doc/src/sgml/func.sgml               | 16 ++++++++--------
src/include/catalog/catversion.h     |  2 +-
src/include/catalog/pg_proc.dat      | 32 +++++++++++++++++---------------
src/test/regress/expected/window.out | 30 ++++++++++++++++++++++++++++++
src/test/regress/sql/window.sql      |  2 ++
5 files changed, 58 insertions(+), 24 deletions(-)



Message-ID: <E1kaP5M-0005So-77@gemulon.postgresql.org>
Permalink:  ../E1kaP5M-0005So-77@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kaP5M-0005So-77@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Declare lead() and lag() using anycompatible not anyelement.
  In-Reply-To: <E1kaP5M-0005So-77@gemulon.postgresql.org>
  References: <E1kaP5M-0005So-77@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox