Re: generated constraint name - Mailing list pgsql-docs

From Euler Taveira
Subject Re: generated constraint name
Date
Msg-id 944a4d69-0bd2-4eec-8886-554fd3f2fa09@app.fastmail.com
Whole thread Raw
In response to Re: generated constraint name  (Yaroslav Saburov <y.saburov@gmail.com>)
List 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

Attachment

pgsql-docs by date:

Previous
From: Yaroslav Saburov
Date:
Subject: Re: generated constraint name
Next
From: PG Doc comments form
Date:
Subject: Hyperlink to Logical replication slots instead of physical