Re: generated constraint name

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "Yaroslav Saburov" <y(dot)saburov(at)gmail(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Peter Eisentraut" <peter(at)eisentraut(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: generated constraint name
Date: 2025-04-11 12:45:02
Message-ID: 944a4d69-0bd2-4eec-8886-554fd3f2fa09@app.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Fri, Apr 11, 2025, at 5:32 AM, Yaroslav Saburov wrote:
>
> Thank you all.
>
>
>
> In order not to open a new thread, (small clarification)
>

Don't be afraid to open a new thread. Indeed, a new topic (even if it is
minimal) deserves a new thread.

> On the tutorial-agg page in the code example
>
>
>
> SELECT city FROM weather WHERE temp_lo = max(temp_lo); WRONG
>
>
>
> you need to add a comment before WRONG
>

If you consider that that query is correct and it fails in the "wrong" then you
made the point.

postgres-# select 1; wrong
ERROR: syntax error at or near "WRONG"
LINE 1: WRONG
^

However, the query is not correct and it fails before processing the second
statement (wrong) so it doesn't matter much in this case. Even after saying
that, I agree with you that this annotation without the comment characters
don't make much sense.

postgres=# SELECT city FROM weather WHERE temp_lo = max(temp_lo); WRONG
ERROR: aggregate functions are not allowed in WHERE
LINE 1: SELECT city FROM weather WHERE temp_lo = max(temp_lo);
^

--
Euler Taveira
EDB https://www.enterprisedb.com/

Attachment Content-Type Size
tutorial.patch text/x-patch 524 bytes

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2025-04-12 16:44:03 Hyperlink to Logical replication slots instead of physical
Previous Message Yaroslav Saburov 2025-04-11 08:32:45 Re: generated constraint name