Re: weird GROUPING SETS and ORDER BY behaviour

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: weird GROUPING SETS and ORDER BY behaviour
Date: 2024-01-08 14:01:40
Message-ID: CAKFQuwZrbWzSiiL2wpY-+E4fOhZ9Fq0gsGS=MQxm6P9XajsYgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday, January 8, 2024, Geoff Winkless <pgsqladmin(at)geoff(dot)dj> wrote
>
>
> Mildly interesting: you can pass column positions to GROUP BY and
> ORDER BY but if you try to pass a position to GROUPING() (I wondered
> if that would help the engine somehow) it fails:
>

The symbol 1 is ambigious - it can be the number or a column reference. In
a compound expression it is always the number, not the column reference.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2024-01-08 14:04:19 Re: Escape output of pg_amcheck test
Previous Message Mark Dilger 2024-01-08 13:52:26 Re: Escape output of pg_amcheck test