Re: How to add a variable to a timestamp.

2022-10-29 Thread Tom Lane
Adrian Klaver writes: > On 10/29/22 10:35, Eagna wrote: >> I'm trying to do something like this. >> '2022-10-31 00:00:00'::TIMESTAMP + INTERVAL 'd.i DAY' That will not work. A literal is a literal, you can't expect that the system will interpret parts of it as variable references. >

Re: How to add a variable to a timestamp.

2022-10-29 Thread Adrian Klaver
On 10/29/22 10:35, Eagna wrote: Hi, I'm trying to do something like this. SELECT   d.i,   h.i,  '2022-10-31 00:00:00'::TIMESTAMP  + INTERVAL 'd.i DAY' FROM   GENERATE_SERIES(0,  6) AS d(i),   GENERATE_SERIES(0, 23) AS h(i); where I add d.i days (and also h.i hours) to a timestamp. I

Re: How to add a variable to a timestamp.

2022-10-29 Thread Erik Wienhold
> On 29/10/2022 19:35 CEST Eagna wrote: > > I'm trying to do something like this. > > SELECT > d.i, > h.i, > > '2022-10-31 00:00:00'::TIMESTAMP + INTERVAL 'd.i DAY' > FROM > GENERATE_SERIES(0, 6) AS d(i), > GENERATE_SERIES(0, 23) AS h(i); > > where I add d.i days (and also h.i hours) to a

How to add a variable to a timestamp.

2022-10-29 Thread Eagna
Hi, I'm trying to do something like this. SELECT d.i, h.i, '2022-10-31 00:00:00'::TIMESTAMP + INTERVAL 'd.i DAY' FROM GENERATE_SERIES(0, 6) AS d(i), GENERATE_SERIES(0, 23) AS h(i); where I add d.i days (and also h.i hours) to a timestamp. I can't seem to get this to work. Any ideas