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

From Surafel Temesgen
Subject Re: Introduce MIN/MAX aggregate functions to pg_lsn
Date
Msg-id CALAY4q-prsp5F794=ipLDoFWEUcPoD2NxY8S-rSZvhO5ACj80g@mail.gmail.com
Whole thread Raw
In response to Introduce MIN/MAX aggregate functions to pg_lsn  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Responses Re: Introduce MIN/MAX aggregate functions to pg_lsn  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
List pgsql-hackers
Hi,
Here are same review comment
-      <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
+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
regards
Surafel

pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: pg_waldump and PREPARE
Next
From: Tomas Vondra
Date:
Subject: Re: Choosing values for multivariate MCV lists