Re: casting... adding integer to timestamp - Mailing list pgsql-general

From Alex Pavlovic
Subject Re: casting... adding integer to timestamp
Date
Msg-id 200606250239.46436.alex.pavlovic@taskforce-1.com
Whole thread Raw
In response to casting... adding integer to timestamp  (Mark Gibson <mark@gibsonsoftware.com>)
List pgsql-general
Yet another way, this time being more explicit.

SELECT play_length - play_seconds * '1 second'::interval


Cheers.

On Saturday 24 June 2006 22:23, Mark Gibson wrote:
> If play_length is a timestamp, I can do this:
>
> SELECT  play_length - INTERVAL '13 seconds' ...
>
> But what if play_seconds is a column?
>
> SELECT  play_length - INTERVAL 'play_seconds seconds' ...
>
> This doesn't work.
>
> ERROR:  invalid input syntax for type interval: "play_seconds seconds"
>
> Can anyone help?
>
> Thanks,
> Mark
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

pgsql-general by date:

Previous
From: Sim Zacks
Date:
Subject: Re: join on next row
Next
From: "Clarence"
Date:
Subject: Re: VACUUM hanging on idle system