Re: What linux version to install ?

2024-04-02 Thread Adrian Klaver
On 4/2/24 16:53, David Gauthier wrote: This is what we are running... Red Hat Enterprise Linux Server release 7.9 (Maipo) In our pandora distrib, I see PG v15.3.  I was wondering if there is something even better. Can't seem to pin this down using https://www.postgresql.org/download/linux/redh

What linux version to install ?

2024-04-02 Thread David Gauthier
This is what we are running... Red Hat Enterprise Linux Server release 7.9 (Maipo) In our pandora distrib, I see PG v15.3. I was wondering if there is something even better. Can't seem to pin this down using https://www.postgresql.org/download/linux/redhat/.

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: Getting wrong datetime in database using insert into table query.

2024-04-02 Thread Adrian Klaver
On 4/2/24 01:58, Saksham Joshi wrote: OS: Windows 10 Psycopg version: 2.9.9 Python version: 3.11.6 PostgreSQL version: 11 pip version : 24.0 1: what you did We are using 'psycopg2-binary' library to connect to my postgresql hosted on Azure.We have created a table named 'apilog' to store our api

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: Getting wrong datetime in database using insert into table query.

2024-04-02 Thread Sándor Daku
On Tue, 2 Apr 2024 at 10:59, Saksham Joshi wrote: > OS: Windows 10 > Psycopg version: 2.9.9 > Python version: 3.11.6 > PostgreSQL version: 11 > pip version : 24.0 > 1: what you did > We are using 'psycopg2-binary' library to connect to my postgresql hosted > on Azure.We have created a table named

Getting wrong datetime in database using insert into table query.

2024-04-02 Thread Saksham Joshi
OS: Windows 10 Psycopg version: 2.9.9 Python version: 3.11.6 PostgreSQL version: 11 pip version : 24.0 1: what you did We are using 'psycopg2-binary' library to connect to my postgresql hosted on Azure.We have created a table named 'apilog' to store our api logs using 'Insert Into table' query.We h

Re: Not able to purge partition

2024-04-02 Thread Laurenz Albe
On Tue, 2024-04-02 at 01:41 +0530, sud wrote: > On Thu, Mar 21, 2024 at 6:18 PM Laurenz Albe wrote: > > > [create some partitions, then drop a partition of the referenced table] > > > > > > SQL Error [P0001]: ERROR: cannot drop table > > > schema1.test_part_drop_parent_p2024_02_01 because other o

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