cast time interval to seconds - Mailing list pgsql-general

From rihad
Subject cast time interval to seconds
Date
Msg-id 46E56647.5060604@mail.ru
Whole thread Raw
Responses Re: cast time interval to seconds
Re: cast time interval to seconds
List pgsql-general
Hi, I have two columns start_time & stop_time declared as "TIME". I'd
like to compute the difference between the two times in seconds, all in db:

SELECT
   (CAST(stop_time AS SECONDS) + 86400 - CAST(start_time AS SECONDS))
   % 86400;

Unfortunately AS SECONDS causes parse error. Any hints? Thanks.

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Checking is TSearch2 query is valid
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Time Zone design issues