On 11-12-2013 09:41, Andres Freund wrote:
> There's already a couple of SQL function dealing with XLogRecPtrs and
> the logical replication work will add a couple of more. Currently each
> of those funtions taking/returning an LSN does sprintf/scanf to
> print/parse the strings. Which both is awkward and potentially
> noticeable performancewise.
>
While discussing pg_xlog_location_diff function, Robert posted a lsn
datatype [1]. At that time we wouldn't go that far (a new datatype) to
cover only one function. If your proposal is just validation, I think
generic validation functions is the way to follow. However, if you are
thinking in adding operators, the lsn datatype should be implemented.
> It seems relatively simple to add a proper type, with implicit casts
> from text, instead?
>
Do you want to change the function signatures too?
[1]
http://www.postgresql.org/message-id/CA+TgmoZRMNN0eVEsD-kxB9e-MvdmwoTi6guuJUvQP_8q2C5Cyg@mail.gmail.com
-- Euler Taveira Timbira - http://www.timbira.com.br/ PostgreSQL: Consultoria, Desenvolvimento,
Suporte24x7 e Treinamento