BUG #18563: Where is tha "FIRST" aggregate function??

Lists: pgsql-bugs
From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: iuritomazini(dot)dev(at)gmail(dot)com
Subject: BUG #18563: Where is tha "FIRST" aggregate function??
Date: 2024-08-01 16:25:19
Message-ID: 18563-bed7c7e283cc81b5@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18563
Logged by: Iuri Tomazini
Email address: iuritomazini(dot)dev(at)gmail(dot)com
PostgreSQL version: 16.0
Operating system: pgAdmin 4
Description:

PostagrSQL do not have a "FIRST" aggraregate function and it is a huge
mistake. All other good database has this and some of them are automatic,
such as MySQL. Take a fast search and discover that this kind of topic is
commonly find in internet (example: stackoverflow site). I am migrating for
other database, bacause of the dificulty to get a similar resource to
substitute the "FIRST" in PostgreSQL and I hope you can recognize this bad
error and implement something to suppply this lack. Good bye!


From: Christophe Pettus <xof(at)thebuild(dot)com>
To: iuritomazini(dot)dev(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18563: Where is tha "FIRST" aggregate function??
Date: 2024-08-01 17:38:29
Message-ID: 8E8D05C8-329E-4D3E-9C31-25A6EB339C4D@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

> On Aug 1, 2024, at 09:25, PG Bug reporting form <noreply(at)postgresql(dot)org> wrote:
> I am migrating for
> other database, bacause of the dificulty to get a similar resource to
> substitute the "FIRST" in PostgreSQL and I hope you can recognize this bad
> error and implement something to suppply this lack. Good bye!

It's trivial to implement in PostgreSQL:

https://wiki.postgresql.org/wiki/First/last_(aggregate)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: iuritomazini(dot)dev(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18563: Where is tha "FIRST" aggregate function??
Date: 2024-08-01 19:23:29
Message-ID: 3781617.1722540209@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Christophe Pettus <xof(at)thebuild(dot)com> writes:
>> On Aug 1, 2024, at 09:25, PG Bug reporting form <noreply(at)postgresql(dot)org> wrote:
>> I am migrating for
>> other database, bacause of the dificulty to get a similar resource to
>> substitute the "FIRST" in PostgreSQL and I hope you can recognize this bad
>> error and implement something to suppply this lack. Good bye!

> It's trivial to implement in PostgreSQL:
> https://wiki.postgresql.org/wiki/First/last_(aggregate)

The built-in (since v16) "any_value()" aggregate is actually just like
what that page shows for "first()". The name is chosen to reflect the
fact that the aggregate itself isn't promising anything: you have to
use it in the correct way to get useful behavior.

regards, tom lane