Re: Syntax error needs explanation [RESOLVED]

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Rich Shepard <rshepard(at)appl-ecosys(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Syntax error needs explanation [RESOLVED]
Date: 2025-07-15 05:55:33
Message-ID: CAKFQuwbBVOCY4kw23R6Q1cCFs0KwTPcGUrBdcWmf62Srnk4=0A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday, July 14, 2025, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:

> On Mon, 2025-07-14 at 12:19 -0700, Rich Shepard wrote:
> > On Mon, 14 Jul 2025, David G. Johnston wrote:
> >
> > > The error indicates your script file is at least 127 lines long and you
> > > are showing like 9...also do you usually name your script files with a
> > > .txt extension?
> >
> > Agh! No the filename extension is .sql. But I was using the \o psql
> option
> > to write script output to files and mistyped the script name.
> >
> > Mea culpa!
>
> Apart from that, the subquery seems to be missing a GROUP BY clause.
>

Well, it’s more that an exists subquery with an aggregate generally doesn’t
make sense (it would need to include a having clause at minimum)…it’s not
missing a group by clause, it has aggregates it doesn’t need (they belong
in they belong in the main query where the group clause exists without
aggregates to justify its existence.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2025-07-15 06:02:06 Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS)
Previous Message Laurenz Albe 2025-07-15 05:46:43 Re: Syntax error needs explanation [RESOLVED]