Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u3DlR-00CNzq-L1 for pgsql-docs@arkaria.postgresql.org; Fri, 11 Apr 2025 12:45:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u3DlP-009DQJ-94 for pgsql-docs@arkaria.postgresql.org; Fri, 11 Apr 2025 12:45:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u3DlO-009DQB-Na for pgsql-docs@lists.postgresql.org; Fri, 11 Apr 2025 12:45:43 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u3DlL-004i1W-2t for pgsql-docs@lists.postgresql.org; Fri, 11 Apr 2025 12:45:42 +0000 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.stl.internal (Postfix) with ESMTP id A0D8511400DA; Fri, 11 Apr 2025 08:45:37 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-07.internal (MEProxy); Fri, 11 Apr 2025 08:45:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1744375537; x=1744461937; bh=qxsuvTTIRZ xphZdYlB2oemk0VAIuPmMhZ5e+jTucD9E=; b=gm2kRkIeN72N/80KTUs9djfcb8 GMCB6c3XVcwEXFW87xA5tFE0lWQ/2pHHfMCsw/MdfHHHypqf9TSNpKO1RCaGCslV PA/8Jeg3r4/P8agf8QVMJgVRxMoL6U9I7ECiYjRVVZPbgb7Jg5S4i0RFz1MZqt31 UonYF1IY52H8O+uNvWVd3+kajCwsW2h0eD5Hz/ONR9+OcM5hIj7o4FMgcG9E1YwQ 4bky9euh6MfhrDDmKF2SUp4j9ufjAFn6FsVeSvRb1yDYWMwAbKkY//WRY7qLUGM6 +qhSoT/xr1Bp3V1ILLNOLKugx5DACiHB22NGUjASxT5O2Fl9feJntD9H4n0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1744375537; x=1744461937; bh=qxsuvTTIRZxphZdYlB2oemk0VAIuPmMhZ5e +jTucD9E=; b=dTDcmQR4xN7B9ITFDWDk2tb6nFwS/gnSQ2r9tg+o66cf1/axeoK FF9uV6vrnlLICws3sMZTTDdiM2mwBUha5yfH482ebdr4eK99GlznEKPu98ZnIN7B 4yIm4GleqLQ8HT3XT2msoju9goGRJtzHgJ/5bZON5QhcGtS7iYer1TOrav3AgXo6 ToHRXLj1VrOtAF87YaFOFqtrrEliaIoUKre9jciRHogLYe2bSDqkltw3DOIErqxG /C8u0hd14R1sLCeE5uUltrV5mdiTTmHF/XfcB4KztWDbU34MFV31GXkPDbqEWKIm GOK/x8293a5oE9+/7B1pHchy4owDU/YXnWA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvuddukeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvfevkfgjfhfutgesmhdtreerredt tdenucfhrhhomhepfdfguhhlvghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvg hrthhordgtohhmqeenucggtffrrghtthgvrhhnpeeffeegkefhledvleffkefhtdeiheei iedvueeihefghfeigeekjefhvefgleefheenucffohhmrghinhepvghnthgvrhhprhhish gvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepvghulhgvrhesvghulhgvrhhtohdrtghomhdpnhgspghrtghpthhtohephedpmh houggvpehsmhhtphhouhhtpdhrtghpthhtohepphgvthgvrhesvghishgvnhhtrhgruhht rdhorhhgpdhrtghpthhtohepuggrvhhiugdrghdrjhhohhhnshhtohhnsehgmhgrihhlrd gtohhmpdhrtghpthhtohephidrshgrsghurhhovhesghhmrghilhdrtghomhdprhgtphht thhopehpghhsqhhlqdguohgtsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpd hrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhush X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 97A08780069; Fri, 11 Apr 2025 08:45:36 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: Tbd7d11b55df19635 Date: Fri, 11 Apr 2025 09:45:02 -0300 From: "Euler Taveira" To: "Yaroslav Saburov" , "Tom Lane" Cc: "Peter Eisentraut" , "David G. Johnston" , pgsql-docs@lists.postgresql.org Message-Id: <944a4d69-0bd2-4eec-8886-554fd3f2fa09@app.fastmail.com> In-Reply-To: References: <520881.1744297980@sss.pgh.pa.us> Subject: Re: generated constraint name Content-Type: multipart/mixed; boundary=fd72fef45c584585b4c61c41119a3e1d List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --fd72fef45c584585b4c61c41119a3e1d Content-Type: multipart/alternative; boundary=42a2ce36bd114be6a62644229fbef4c6 --42a2ce36bd114be6a62644229fbef4c6 Content-Type: text/plain Content-Transfer-Encoding: 7bit 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/ --42a2ce36bd114be6a62644229fbef4c6 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Fri, Apr 11,= 2025, at 5:32 AM, Yaroslav Saburov wrote:

Thank you all.


In order not to ope= n 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 =3D max(temp_lo= ); WRONG


you need to add a co= mment before WRONG


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

postgres-# select 1;&nbs= p;   wrong
ERROR:  syntax error at or near "WRO= NG"
LINE 1: WRONG
     &nbs= p;  ^

However, the query is not correct an= d it fails before processing the second
statement (wrong) so i= t 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=3D# SELECT= city FROM weather WHERE temp_lo =3D max(temp_lo);   &nbs= p; WRONG
ERROR:  aggregate functions are not allowed in W= HERE
LINE 1: SELECT city FROM weather WHERE temp_lo =3D max(te= mp_lo);
         =             =             =             =     ^


--
Euler= Taveira

--42a2ce36bd114be6a62644229fbef4c6-- --fd72fef45c584585b4c61c41119a3e1d Content-Disposition: attachment; filename="tutorial.patch" Content-Type: text/x-patch; name="tutorial.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2RvYy9zcmMvc2dtbC9xdWVyeS5zZ21sIGIvZG9jL3NyYy9zZ21sL3F1 ZXJ5LnNnbWwKaW5kZXggNTk5NjJkNmU4NTYuLjcyN2EwY2IxODVmIDEwMDY0NAotLS0gYS9k b2Mvc3JjL3NnbWwvcXVlcnkuc2dtbAorKysgYi9kb2Mvc3JjL3NnbWwvcXVlcnkuc2dtbApA QCAtNjcxLDcgKzY3MSw3IEBAIFNFTEVDVCBtYXgodGVtcF9sbykgRlJPTSB3ZWF0aGVyOwog ICAgIHdlIG1pZ2h0IHRyeToKIAogPHByb2dyYW1saXN0aW5nPgotU0VMRUNUIGNpdHkgRlJP TSB3ZWF0aGVyIFdIRVJFIHRlbXBfbG8gPSBtYXgodGVtcF9sbyk7ICAgICA8bGluZWFubm90 YXRpb24+V1JPTkc8L2xpbmVhbm5vdGF0aW9uPgorU0VMRUNUIGNpdHkgRlJPTSB3ZWF0aGVy IFdIRVJFIHRlbXBfbG8gPSBtYXgodGVtcF9sbyk7ICAgICA8bGluZWFubm90YXRpb24+LS0g V1JPTkc8L2xpbmVhbm5vdGF0aW9uPgogPC9wcm9ncmFtbGlzdGluZz4KIAogICAgIGJ1dCB0 aGlzIHdpbGwgbm90IHdvcmsgc2luY2UgdGhlIGFnZ3JlZ2F0ZQo= --fd72fef45c584585b4c61c41119a3e1d--