Re: Introduce MIN/MAX aggregate functions to pg_lsn

Поиск
Список
Период
Сортировка
От Surafel Temesgen
Тема Re: Introduce MIN/MAX aggregate functions to pg_lsn
Дата
Msg-id CALAY4q-prsp5F794=ipLDoFWEUcPoD2NxY8S-rSZvhO5ACj80g@mail.gmail.com
обсуждение исходный текст
Ответ на Introduce MIN/MAX aggregate functions to pg_lsn  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Ответы Re: Introduce MIN/MAX aggregate functions to pg_lsn  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: pg_waldump and PREPARE
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Choosing values for multivariate MCV lists