Re: Timestamp conversion Error in dynamic sql script

2024-04-03 Thread sud
This one worked. Thank you so much. On Wed, Apr 3, 2024 at 2:27 AM Erik Wienhold wrote: > On 2024-04-02 22:08 +0200, sud wrote: > > On Tue, Apr 2, 2024 at 7:46 PM Greg Sabino Mullane > > wrote: > > > > Now this block seems to be failing near the "LIKE" operator. Isn't it > > allowed to add the

Re: Timestamp conversion Error in dynamic sql script

2024-04-02 Thread Erik Wienhold
On 2024-04-02 22:08 +0200, sud wrote: > On Tue, Apr 2, 2024 at 7:46 PM Greg Sabino Mullane > wrote: > > Now this block seems to be failing near the "LIKE" operator. Isn't it > allowed to add the check constraints along with the CREATE TABLE statement? > > [...] > > EXECUTE format(' > CREATE

Re: Timestamp conversion Error in dynamic sql script

2024-04-02 Thread sud
On Tue, Apr 2, 2024 at 7:46 PM Greg Sabino Mullane wrote: > 1. Declare start_date as DATE when you want to add days with date + int >> 2. Keep TIMESTAMP and use start_date + make_interval(days => i) >> > > Also > > 0. Use TIMESTAMPTZ not TIMESTAMP > > > Thank you so much. That helped. Now this b

Re: Timestamp conversion Error in dynamic sql script

2024-04-02 Thread Greg Sabino Mullane
> > 1. Declare start_date as DATE when you want to add days with date + int > 2. Keep TIMESTAMP and use start_date + make_interval(days => i) > Also 0. Use TIMESTAMPTZ not TIMESTAMP Cheers, Greg

Re: Timestamp conversion Error in dynamic sql script

2024-04-02 Thread Erik Wienhold
On 2024-04-02 07:38 +0200, sud wrote: > I am trying to create a block which will create a few partitions > dynamically and also insert ~1million rows into each of those partitions. > Not able to figure out why it's giving below error during timezone > conversion while defining the partitions even t

Re: Timestamp conversion Error in dynamic sql script

2024-04-02 Thread Laurenz Albe
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, '_MM

Timestamp conversion Error in dynamic sql script

2024-04-01 Thread sud
Hello , I am trying to create a block which will create a few partitions dynamically and also insert ~1million rows into each of those partitions. Not able to figure out why it's giving below error during timezone conversion while defining the partitions even though I used the typecast? CREATE TAB