Re: abs function for interval - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: abs function for interval
Date
Msg-id CAHE3wgjO_01xe-urxoFy65iASZ1+8G3HiBenLqFQOxcX9YyStg@mail.gmail.com
Whole thread Raw
In response to Re: abs function for interval  (Andres Freund <andres@anarazel.de>)
Responses Re: abs function for interval  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Em qui, 31 de out de 2019 às 23:45, Andres Freund <andres@anarazel.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



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Allow CREATE OR REPLACE VIEW to rename the columns
Next
From: "lingce.ldm"
Date:
Subject: Re: Problem with synchronous replication