Re: concerns around pg_lsn

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: concerns around pg_lsn
Дата
Msg-id 20190801091229.GA3345@paquier.xyz
обсуждение исходный текст
Ответ на Re: concerns around pg_lsn  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Ответы Re: concerns around pg_lsn  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Список pgsql-hackers
On Thu, Aug 01, 2019 at 02:10:08PM +0530, Jeevan Ladhe wrote:
> The only thing is that, if the caller cares about the error during
> the parsing or not.

That's where the root of the problem is.  We should really make things
so as the caller of this routine cares about errors.  With your patch
a caller could do pg_lsn_in_internal('G/G', NULL), and then get
InvalidXLogRecPtr which is plain wrong.  It is true that a caller may
not care about the error, but the idea is to make callers *think*
about the error case when they implement something and decide if it is
valid or not.  The float and numeric code paths do that, not pg_lsn
with this patch.  It would actually be fine to move ereport(ERROR)
from pg_lsn_in to pg_lsn_in_internal and trigger these if have_error
is NULL, but that means a duplication and the code is simple.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Shay Rojansky
Дата:
Сообщение: Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: improve PQexec documentation