public inbox for [email protected]  
help / color / mirror / Atom feed
From: Stephen Frost <[email protected]>
To: James Keener <[email protected]>
Cc: David G. Johnston <[email protected]>
Cc: Roger Mason <[email protected]>
Cc: pgsql-novice <[email protected]>
Cc: [email protected]
Subject: Re: select from grouped data
Date: Wed, 25 Aug 2021 18:03:56 -0400
Message-ID: <CAOuzzgpa7+octXt69xQZ7x_w_ppRdUHAGTtBDGKoiTgk2LPvaA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

Greetings,

We generally prefer to reply in-line on these threads, as I’ve done below.
Thanks.

On Wed, Aug 25, 2021 at 17:37 James Keener <[email protected]> wrote:

> I don't know that "generally better" is the correct description. There are
> a lot of things not covered by the SQL standard and it would be crazy not
> to make use of them, e.g. insert on conflict and distinct on, especially
> when they make the query more readable and more correct. Worrying about sql
> portability is almost always time not well spent and an invitation to do
> things not as well as they can be.
>

It’s generally better as it follows the SQL standard and is more flexible
as it allows you to get top-N, as I said. DISTINCT ON has always been a
hack and its use should be discouraged at this point.

When an UPSERT capability exists in the actual standard then it’s use
should be promoted over other hacks that various vendors have implemented
also.

Thanks again,

Stephen


view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: select from grouped data
  In-Reply-To: <CAOuzzgpa7+octXt69xQZ7x_w_ppRdUHAGTtBDGKoiTgk2LPvaA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox