Re: Introduce MIN/MAX aggregate functions to pg_lsn - Mailing list pgsql-hackers

From Fabrízio de Royes Mello
Subject Re: Introduce MIN/MAX aggregate functions to pg_lsn
Date
Msg-id CAFcNs+qC_Up88uvA9sS2F+KEjvMk0+oWoLRSP4gphhHwJk58zA@mail.gmail.com
Whole thread Raw
In response to Re: Introduce MIN/MAX aggregate functions to pg_lsn  (Surafel Temesgen <surafel3000@gmail.com>)
Responses Re: Introduce MIN/MAX aggregate functions to pg_lsn  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers


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
Attachment

pgsql-hackers by date:

Previous
From: Adam Berlin
Date:
Subject: Re: C testing for Postgres
Next
From: Anthony Nowocien
Date:
Subject: Re: progress report for ANALYZE