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

From Mark Gibson
Subject casting... adding integer to timestamp
Date
Msg-id 449E1DED.2000305@gibsonsoftware.com
Whole thread Raw
Responses Re: casting... adding integer to timestamp
Re: casting... adding integer to timestamp
Re: casting... adding integer to timestamp
List pgsql-general

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

pgsql-general by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: auto-vacuum & Negative "anl" Values
Next
From: Michael Glaesemann
Date:
Subject: Re: casting... adding integer to timestamp