Search Postgresql Archives

Re: Timestamp conversion Error in dynamic sql script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2024-04-02 at 11:08 +0530, sud wrote:
> Not able to figure out why it's giving below error during timezone conversion
> while defining the partitions even though I used the typecast? 
> 
> [...]
> DECLARE
> start_date TIMESTAMP := '2022-01-01';
> [...]
>     TO_CHAR(start_date + i, 'YYYY_MM_DD')
> 
> ***********
> SQL Error [42883]: ERROR: operator does not exist: timestamp without time zone + integer
> Hint: No operator matches the given name and argument types. You might need to add explicit type casts.

As the error states, you cannot add an integer to a timestamp.

What is the supposed meaning of that addition?

Yours,
Laurenz Albe






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux