Re: Add sortsupport to money_ops, pg_lsn_ops and xid8_ops

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add sortsupport to money_ops, pg_lsn_ops and xid8_ops
Date: 2026-12-02 21:06:48
Message-ID: CADkLM=dyV0ZK2bqE2pDgivuMtb0XgRksc59qShz8pCFPgXbdkg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 13, 2026 at 4:08 AM Andreas Karlsson <andreas(at)proxel(dot)se> wrote:

> On 11/9/26 08:53, David Rowley wrote:
> > On Mon, 9 Nov 2026 at 17:10, Kirill Reshke <reshkekirill(at)gmail(dot)com>
> wrote:
> >> It didn't occur to me that this would require any maintenance cost.
> >> Saying that, I think money type is something people use
> >
> > Any basis for those thoughts? I've only ever seen its usage
> > discouraged and even a short discussion [1] on how we might remove it
> > one day.
> >
> > Perhaps we should make pg_upgrade start kicking out warnings in v20
> > and then remove it in v25... Or reconsider that if we receive too many
> > complaints.
>
> Yeah, I think we should deprecate the money type. It is weird and
> confusing to any user and the name makes some people think that it is
> useful for storing money when it is generally not. I would rather that
> we work on deprecating it over improving it. Maybe it can be turned into
> an extension for the people who want it, but the issue is pg_upgrade and
> type type oid.

I reached out to a contact at Datadog who has access to anonymized customer
usage data, and asked about the observed usage of the money data type.
Here's what I got back:

1. 0.0032% of all columns are of type money.
2. customers with at least 1 money column: 2.68%
3. customers with exactly 1 occurrence of money in their fleet: 14% (of all
customers who have at least 1 occurrence)

#1 is very low, but far higher than I imagined.

#2 is also higher than I imagined.

#3 was asked because I suspected that customers might be supporting some
sort of tool/library and they needed tests to prove that they can handle
all existing postgres types, and thus would have very minimal usage of the
money type...and their need of the datatype would disappear if the type
were removed. This appears to be somewhat true, but either the level is
lower than I expected, or the test suites require more than one usage, no
real way to tell.

I had hoped that this research would show that usage was vanishingly small,
giving us a reason to pursue a more aggressive deprecation schedule, but
that doesn't appear to be the case.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2026-12-02 21:08:59 DROP SUBSCRIPTION deadlock with ALTER SUBSCRIPTION OWNER TO
Previous Message Greg Burd 2026-12-02 20:44:13 Re: Quickselect instead of a heap for ORDER BY ... LIMIT N large bounded sorts