Re: abs function for interval

From: Euler Taveira <euler(at)timbira(dot)com(dot)br>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: abs function for interval
Date: 2019-11-01 03:48:50
Message-ID: CAHE3wgjO_01xe-urxoFy65iASZ1+8G3HiBenLqFQOxcX9YyStg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em qui, 31 de out de 2019 às 23:45, Andres Freund <andres(at)anarazel(dot)de> escreveu:
>
> 1) I don't think you can do the < 0 check on an elementwise basis. Your
> code would e.g. make a hash out of abs('1 day -1 second'), by
> inverting the second, but not the day (whereas nothing should be
> done).
>
> It'd probably be easiest to implement this by comparing with a 0
> interval using inteval_lt() or interval_cmp_internal().
>
Hmm. Good idea. Let me try it.

--
Euler Taveira Timbira -
http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message lingce.ldm 2019-11-01 05:27:54 Re: Problem with synchronous replication
Previous Message Fujii Masao 2019-11-01 03:42:43 Re: Allow CREATE OR REPLACE VIEW to rename the columns