| From: | Surafel Temesgen <surafel3000(at)gmail(dot)com> |
|---|---|
| To: | fabriziomello(at)gmail(dot)com |
| Cc: | Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Introduce MIN/MAX aggregate functions to pg_lsn |
| Date: | 2019-07-02 10:22:32 |
| Message-ID: | CALAY4q-prsp5F794=ipLDoFWEUcPoD2NxY8S-rSZvhO5ACj80g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tomas Vondra | 2019-07-02 10:25:55 | Re: Choosing values for multivariate MCV lists |
| Previous Message | Julien Rouhaud | 2019-07-02 10:15:50 | Re: pg_waldump and PREPARE |