Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l31f3-0005HX-Dr for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2021 18:59:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l31f2-0002my-1E for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2021 18:59:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l31f1-0002mp-Q6 for pgsql-hackers@lists.postgresql.org; Fri, 22 Jan 2021 18:59:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l31ez-00029l-O0 for pgsql-hackers@lists.postgresql.org; Fri, 22 Jan 2021 18:59:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 10MIxoSV1171053; Fri, 22 Jan 2021 13:59:50 -0500 From: Tom Lane To: Pavel Stehule cc: easteregg@verfriemelt.org, PostgreSQL Hackers Subject: Re: plpgsql variable assignment not supporting distinct anymore In-reply-to: References: <20210122134106.e94c5cd7@mail.verfriemelt.org> Comments: In-reply-to Pavel Stehule message dated "Fri, 22 Jan 2021 14:58:50 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1171051.1611341990.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 22 Jan 2021 13:59:50 -0500 Message-ID: <1171052.1611341990@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Pavel Stehule writes: > pá 22. 1. 2021 v 14:41 odesílatel napsal: >> ERROR: syntax error at or near "DISTINCT" >> LINE 8: _test := DISTINCT a FROM ( VALUES ( (true), ( true ) ) )... > Using DISTINCT is not a good solution. Yeah. It wouldn't be as painful to support this in the grammar as it would be for UNION et al, so maybe we should just do it. But I still find this to be mighty ugly plpgsql code. regards, tom lane