Re: Timestamp conversion Error in dynamic sql script

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Timestamp conversion Error in dynamic sql script
Дата
Msg-id 0b5cb6d1e2174f8993511e31f40d5d7f08d48ec4.camel@cybertec.at
обсуждение исходный текст
Ответ на [MASSMAIL]Timestamp conversion Error in dynamic sql script  (sud <suds1434@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: sud
Дата:
Сообщение: [MASSMAIL]Timestamp conversion Error in dynamic sql script
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Not able to purge partition