Re: [PATCH] Add native PIVOT syntax for SQL Server/Oracle compatibility

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Myles Lewis <myles93(at)sbcglobal(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Add native PIVOT syntax for SQL Server/Oracle compatibility
Date: 2025-11-25 20:21:49
Message-ID: 54582db0-8b11-45de-97e2-0382c9f632e6@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25.11.25 06:01, Myles Lewis wrote:
> I've developed a patch that adds native PIVOT syntax to PostgreSQL,
> enabling SQL Server and Oracle-style pivot queries.

Your patch does not contain any documentation, so it's hard to tell what
this is supposed to do if you don't already know those other products.
Can you supply at least some informal documentation, and maybe some
links to relevant documentation from those other products.

> - Supports SUM, COUNT, AVG, MIN, MAX

Hardcoding aggregate names like this is not going to work. Aggregate
functions can be user-defined, so you can't tell just from the name what
they are doing. You'll need to look them up in the catalog based on
their properties.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-11-25 20:46:49 Re: Buffer locking is special (hints, checksums, AIO writes)
Previous Message Tom Lane 2025-11-25 20:17:28 Re: Optimize LISTEN/NOTIFY