Re: Timestamp conversion Error in dynamic sql script - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Timestamp conversion Error in dynamic sql script
Date
Msg-id 0b5cb6d1e2174f8993511e31f40d5d7f08d48ec4.camel@cybertec.at
Whole thread Raw
In response to [MASSMAIL]Timestamp conversion Error in dynamic sql script  (sud <suds1434@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: sud
Date:
Subject: [MASSMAIL]Timestamp conversion Error in dynamic sql script
Next
From: Laurenz Albe
Date:
Subject: Re: Not able to purge partition