Re: Introduce MIN/MAX aggregate functions to pg_lsn
Fabrízio de Royes Mello <fabriziomello@gmail.com>
From: Fabrízio de Royes Mello <fabriziomello@gmail.com>
To: Surafel Temesgen <surafel3000@gmail.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2019-07-02T14:31:49Z
Lists: pgsql-hackers
Attachments
- add_min_max_aggregates_for_pg_lsn_type_v2.patch (text/x-patch) patch v2
On Tue, Jul 2, 2019 at 7:22 AM Surafel Temesgen <surafel3000@gmail.com>
wrote:
>
> Hi,
> Here are same review comment
Thanks for your review.
> - <entry>any numeric, string, date/time, network, or enum type,
> + <entry>any numeric, string, date/time, network, lsn, or enum type,
> or arrays of these types</entry>
> <entry>same as argument type</entry>
> In the documentation it refereed as pg_lsn type rather than lsn alone
Fixed.
> +Datum
> +pg_lsn_larger(PG_FUNCTION_ARGS)
> +{
> + XLogRecPtr lsn1 = PG_GETARG_LSN(0);
> + XLogRecPtr lsn2 = PG_GETARG_LSN(1);
> + XLogRecPtr result;
> +
> + result = ((lsn1 > lsn2) ? lsn1 : lsn2);
> +
> + PG_RETURN_LSN(result);
> +}
>
> rather than using additional variable its more readable and effective to
return the argument
> itself like we do in date data type and other place
>
Fixed.
New version attached.
Regards,
--
Fabrízio de Royes Mello Timbira - http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
Commits
-
Add min() and max() aggregates for pg_lsn
- 313f87a17155 13.0 landed