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 1ofPP2-0000Nm-G8 for pgsql-novice@arkaria.postgresql.org; Mon, 03 Oct 2022 17:38:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ofPP1-0005tv-9u for pgsql-novice@arkaria.postgresql.org; Mon, 03 Oct 2022 17:38:51 +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 1ofPP0-0005tm-Uy for pgsql-novice@lists.postgresql.org; Mon, 03 Oct 2022 17:38:51 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ofPOt-0004di-Sd for pgsql-novice@lists.postgresql.org; Mon, 03 Oct 2022 17:38:50 +0000 Received: by mail-lj1-x22e.google.com with SMTP id l14so2530162lja.8 for ; Mon, 03 Oct 2022 10:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=keksi-io.20210112.gappssmtp.com; s=20210112; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date; bh=T0pZUZ5chPwiQVe76jp3rfu+oABxgOVhRZKgBx63sPM=; b=BsBjoz+VdXTa8ptgVSZC1Q6Z+t5MI35fN1FAYPqkG45uiq4Ki4HA24DhYi/sAIREp3 4p/fGdkt1hkfb0arysl5aOm2VXjHuAAQy7MdYZ6kE9KXRERWIsOfh4lic+Qf/1Aq16f+ 2ONa1OSYkQXammlY5xCBi+1/n5iHCucv/XbMWgbhJM+pafADKEwyBhbCXi7q5VdERfqM JZ1Hlcqrxo720wSLT1DIH8lnWI/jl8fHwZXhJR10NEYT7lLe2u/KLfVCr3NiORLULkAP CfT+Z/JL9Fb7/LYB19vi9bOxi4ihr30EgQbqIlV4gRwk1qH05/2N1hW40eSzLP1QLbsa YjtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date; bh=T0pZUZ5chPwiQVe76jp3rfu+oABxgOVhRZKgBx63sPM=; b=6Nj7Fhv4SJ6spEDqbTpANUyX+Q8+eDo3ZS4o60U6s22oM98FENPIBWxavuxHLoE7B0 mVMd4CPDizc37q3gblvvX56jeQwFslHfvHnCF3gR9wQJgrgdBRi/MLkgkLMhLLBYjivp +59c+W5IUPWuMdsJdHI3hKwQqjNzsHAbMYd7nVyzxbtf8XEMlkCRyB08ZTlEJyg3r83+ RRm8zIKb4RvjX857xtYId2u2rVaR3kuTO8Yrgl4YbIH82PJNlsW/1zSNQhqHatP3Ukrs ABG8OUwV6gBnTl0pgdwzgdZR7kK5UDSceFBruDqI9DVFMucPNBKIHC/Hp3ROH6u+q/qH dIeA== X-Gm-Message-State: ACrzQf2dG/OC1sVT3OkUzUL1uYiDMiadIyINDAY/1sQqK1wZyLvz3onq E68Ns3ZyjWi/8Po49p0DWlOhD5K5fhUUYZCa X-Google-Smtp-Source: AMsMyM7kjczLPlIyP+zlPrJm7J4EDmRCj+P7PaBSR7dTt04jFDxt82zdPpV/tZxSJiH+mFheRo4FpA== X-Received: by 2002:a2e:94c3:0:b0:26d:e00b:d973 with SMTP id r3-20020a2e94c3000000b0026de00bd973mr1578530ljh.383.1664818722077; Mon, 03 Oct 2022 10:38:42 -0700 (PDT) Received: from smtpclient.apple (150-12-191-90.dyn.estpak.ee. [90.191.12.150]) by smtp.gmail.com with ESMTPSA id br32-20020a056512402000b004979df1c1fasm1547939lfb.61.2022.10.03.10.38.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Oct 2022 10:38:41 -0700 (PDT) From: Onni Hakala Content-Type: multipart/alternative; boundary="Apple-Mail=_D74924D3-78F8-4DAE-BF70-9F8E8B359C57" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: How can I create a feature request for QUALIFY clause into PostgreSQL? Message-Id: <6E722EEC-61FE-4EC0-B17D-B4468DA34BA1@keksi.io> Date: Mon, 3 Oct 2022 20:38:41 +0300 To: pgsql-novice@lists.postgresql.org X-Mailer: Apple Mail (2.3696.120.41.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_D74924D3-78F8-4DAE-BF70-9F8E8B359C57 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hey, I was very happy learn about QUALIFY clause in BigQuery = today. I have used window functions usually with subqueries like this: SELECT * FROM ( SELECT *, ROW_NUMBER OVER (PARTITION BY something ORDER BY modified_date DESC) = AS row_number FROM table_name ) WHERE row_number =3D 1 With QUALIFY it's much more ergonomic and cleaner to do the same thing. SELECT * FROM table_name QUALIFY ROW_NUMBER() OVER (PARTITION BY something ORDER BY modified_date = DESC) =3D 1 QUALIFY is also better since it doesn't include extra column row_number = to the result. Where should I send message so that Postgres maintainers would consider = adding this into the TODO page: https://wiki.postgresql.org/wiki/Todo = Thanks in advance, Onni Hakala= --Apple-Mail=_D74924D3-78F8-4DAE-BF70-9F8E8B359C57 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Hey,

I = was very happy learn about QUALIFY clause in = BigQuery today.

I have used window functions usually = with subqueries like this:
SELECT * FROM (
  SELECT
    *,
    ROW_NUMBER OVER (PARTITION BY something ORDER BY modified_date DESC) =
AS row_number
  FROM table_name
)
WHERE row_number =3D 1

With QUALIFY it's much more ergonomic and cleaner to do the = same thing.
SELECT *
FROM table_name
QUALIFY ROW_NUMBER() OVER (PARTITION BY something ORDER BY modified_date =
DESC) =3D 1

QUALIFY is also better since it doesn't include extra column = row_number to the result.

Where should I send message so that Postgres maintainers = would consider adding this into the TODO page: https://wiki.postgresql.org/wiki/Todo

Thanks in = advance,
Onni = Hakala
= --Apple-Mail=_D74924D3-78F8-4DAE-BF70-9F8E8B359C57--