casting... adding integer to timestamp

From: Mark Gibson <mark(at)gibsonsoftware(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: casting... adding integer to timestamp
Date: 2006-06-25 05:23:57
Message-ID: 449E1DED.2000305@gibsonsoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2006-06-25 05:54:17 Re: casting... adding integer to timestamp
Previous Message Clarence 2006-06-25 01:53:16 Re: VACUUM hanging on idle system