Re: partitioning and identity column

2024-05-09 Thread Ashutosh Bapat
Thanks a lot Peter. On Wed, May 8, 2024 at 2:34 AM Peter Eisentraut wrote: > On 30.04.24 12:59, Ashutosh Bapat wrote: > > PFA patch which fixes all the three problems. > > I have committed this patch. Thanks all. > -- Best Wishes, Ashutosh Bapat

Re: partitioning and identity column

2024-05-07 Thread Peter Eisentraut
On 30.04.24 12:59, Ashutosh Bapat wrote: PFA patch which fixes all the three problems. I have committed this patch. Thanks all.

Re: partitioning and identity column

2024-05-06 Thread Dmitry Dolgov
> On Mon, May 06, 2024 at 06:52:41PM +0530, Ashutosh Bapat wrote: > On Sun, May 5, 2024 at 1:43 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > I had a quick look, it covers the issues mentioned above in the thread. > > Few nitpicks/questions: > > > > * I think it makes sense to verify if the p

Re: partitioning and identity column

2024-05-06 Thread Ashutosh Bapat
On Sun, May 5, 2024 at 1:43 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > On Tue, Apr 30, 2024 at 04:29:11PM +0530, Ashutosh Bapat wrote: > > On Sun, Apr 28, 2024 at 12:29 PM Alexander Lakhin > > wrote: > > > > > 27.04.2024 18:00, Alexander Lakhin wrote: > > > > > > > > Please look also at

Re: partitioning and identity column

2024-05-04 Thread Dmitry Dolgov
> On Tue, Apr 30, 2024 at 04:29:11PM +0530, Ashutosh Bapat wrote: > On Sun, Apr 28, 2024 at 12:29 PM Alexander Lakhin > wrote: > > > 27.04.2024 18:00, Alexander Lakhin wrote: > > > > > > Please look also at another script, which produces the same error: > > > > I've discovered yet another problema

Re: partitioning and identity column

2024-04-30 Thread Michael Paquier
On Tue, Apr 30, 2024 at 04:29:11PM +0530, Ashutosh Bapat wrote: > PFA patch which fixes all the three problems. Please note that this was not tracked as an open item, so I have added one referring to the failures reported by Alexander. -- Michael signature.asc Description: PGP signature

Re: partitioning and identity column

2024-04-30 Thread Ashutosh Bapat
On Sun, Apr 28, 2024 at 12:29 PM Alexander Lakhin wrote: > 27.04.2024 18:00, Alexander Lakhin wrote: > > > > Please look also at another script, which produces the same error: > > I've discovered yet another problematic case: > CREATE TABLE tbl1 (a int GENERATED ALWAYS AS IDENTITY, b text) >

Re: partitioning and identity column

2024-04-28 Thread Alexander Lakhin
27.04.2024 18:00, Alexander Lakhin wrote: Please look also at another script, which produces the same error: I've discovered yet another problematic case: CREATE TABLE tbl1 (a int GENERATED ALWAYS AS IDENTITY, b text)     PARTITION BY LIST (a); CREATE TABLE tbl2 (b text, a int NOT NULL); ALTER

Re: partitioning and identity column

2024-04-27 Thread Alexander Lakhin
Hello Ashutosh, 26.04.2024 21:00, Alexander Lakhin wrote: 26.04.2024 15:57, Ashutosh Bapat wrote: Thanks Alexander for the report. On Fri, Apr 26, 2024 at 5:30 PM Alexander Lakhin wrote: CREATE TABLE tbl3 (LIKE tbl2 INCLUDING IDENTITY); ERROR:  no owned sequence found Do you w

Re: partitioning and identity column

2024-04-26 Thread Alexander Lakhin
26.04.2024 15:57, Ashutosh Bapat wrote: Thanks Alexander for the report. On Fri, Apr 26, 2024 at 5:30 PM Alexander Lakhin wrote: CREATE TABLE tbl3 (LIKE tbl2 INCLUDING IDENTITY); ERROR:  no owned sequence found I don't think creating a table like a partition is common or even useful

Re: partitioning and identity column

2024-04-26 Thread Ashutosh Bapat
Thanks Alexander for the report. On Fri, Apr 26, 2024 at 5:30 PM Alexander Lakhin wrote: > Hello Ashutosh and Peter, > > 16.01.2024 21:59, Peter Eisentraut wrote: > > On 09.01.24 15:10, Ashutosh Bapat wrote: > >> Here's complete patch-set. > > > > Looks good! Committed. > > > > Please take a lo

Re: partitioning and identity column

2024-04-26 Thread Alexander Lakhin
Hello Ashutosh and Peter, 16.01.2024 21:59, Peter Eisentraut wrote: On 09.01.24 15:10, Ashutosh Bapat wrote: Here's complete patch-set. Looks good!  Committed. Please take a look at a new error case introduced by 699586315: CREATE TABLE tbl1 (a int PRIMARY KEY GENERATED BY DEFAULT AS IDENT

Re: partitioning and identity column

2024-02-20 Thread Alexander Korotkov
On Tue, Feb 20, 2024 at 8:00 AM Alexander Lakhin wrote: > 20.02.2024 07:57, Ashutosh Bapat wrote: > >> Could you please name functions, which you suspect, for me to recheck them? > >> Perhaps we should consider fixing all of such functions, in light of > >> b0f7dd915 and d57b7cc33... > > Looks lik

Re: partitioning and identity column

2024-02-19 Thread Alexander Lakhin
20.02.2024 07:57, Ashutosh Bapat wrote: Could you please name functions, which you suspect, for me to recheck them? Perhaps we should consider fixing all of such functions, in light of b0f7dd915 and d57b7cc33... Looks like the second commit has fixed all other places I knew except Identity relat

Re: partitioning and identity column

2024-02-19 Thread Ashutosh Bapat
On Mon, Feb 19, 2024 at 8:30 PM Alexander Lakhin wrote: > > Hello Ashutosh, > > 19.02.2024 15:17, Ashutosh Bapat wrote: > > > >> Functions ATExecAddIdentity() and ATExecDropIdentity() are recursive too, > >> so I think they can be exploited as well. > > not just Identity related functions, but man

Re: partitioning and identity column

2024-02-19 Thread Alexander Lakhin
Hello Ashutosh, 19.02.2024 15:17, Ashutosh Bapat wrote: Functions ATExecAddIdentity() and ATExecDropIdentity() are recursive too, so I think they can be exploited as well. not just Identity related functions, but many other functions in tablecmds.c have that problem as I mentioned earlier.

Re: partitioning and identity column

2024-02-19 Thread Ashutosh Bapat
On Thu, Feb 15, 2024 at 11:30 PM Alexander Lakhin wrote: > > Hello Ashutosh, > > 24.01.2024 09:34, Ashutosh Bapat wrote: > > > >>> There's another thing I found. The file isn't using > >>> check_stack_depth() in the function which traverse inheritance > >>> hierarchies. This isn't just a problem o

Re: partitioning and identity column

2024-02-15 Thread Alexander Lakhin
Hello Ashutosh, 24.01.2024 09:34, Ashutosh Bapat wrote: There's another thing I found. The file isn't using check_stack_depth() in the function which traverse inheritance hierarchies. This isn't just a problem of the identity related function but most of the functions in that file. Do you thin

Re: partitioning and identity column

2024-01-23 Thread Ashutosh Bapat
On Wed, Jan 24, 2024 at 12:04 PM Ashutosh Bapat wrote: > > > > Ok. Maybe just rephrase that comment somehow then? > > Please see refactoring patches attached to [1]. Refactoring that way > makes it unnecessary to mention "regular inheritance" in each comment. > Yet I have included a modified vers

Re: partitioning and identity column

2024-01-23 Thread Ashutosh Bapat
On Tue, Jan 23, 2024 at 12:29 AM Peter Eisentraut wrote: > > On 22.01.24 13:23, Ashutosh Bapat wrote: > >> if (newdef->identity) > >> { > >> Assert(!is_partioning); > >> /* > >>* Identity is never inherited. The new column can have an > >>*

Re: partitioning and identity column

2024-01-22 Thread Peter Eisentraut
On 22.01.24 13:23, Ashutosh Bapat wrote: if (newdef->identity) { Assert(!is_partioning); /* * Identity is never inherited. The new column can have an * identity definition, so we always just take that one. */ def->identit

Re: partitioning and identity column

2024-01-22 Thread Ashutosh Bapat
On Mon, Jan 22, 2024 at 5:32 PM Peter Eisentraut wrote: > > I found another piece of code that might need updating, or at least the > comment. > > In MergeAttributes(), in the part that merges the specified column > definitions into the inherited ones, it says > > /* > * Identity is nev

Re: partitioning and identity column

2024-01-22 Thread Peter Eisentraut
On 17.01.24 06:36, Ashutosh Bapat wrote: On Wed, Jan 17, 2024 at 12:30 AM Peter Eisentraut wrote: On 09.01.24 15:10, Ashutosh Bapat wrote: Here's complete patch-set. Looks good! Committed. Thanks a lot Peter. I found another piece of code that might need updating, or at least the com

Re: partitioning and identity column

2024-01-16 Thread Ashutosh Bapat
On Wed, Jan 17, 2024 at 12:30 AM Peter Eisentraut wrote: > > On 09.01.24 15:10, Ashutosh Bapat wrote: > > Here's complete patch-set. > > Looks good! Committed. > Thanks a lot Peter. -- Best Wishes, Ashutosh Bapat

Re: partitioning and identity column

2024-01-16 Thread Peter Eisentraut
On 09.01.24 15:10, Ashutosh Bapat wrote: Here's complete patch-set. Looks good! Committed.

Re: partitioning and identity column

2024-01-09 Thread Ashutosh Bapat
On Thu, Dec 21, 2023 at 4:32 PM Peter Eisentraut wrote: > > On 19.12.23 11:47, Ashutosh Bapat wrote: > > At this point I am looking for opinions on the above rules and whether > > the implementation is on the right track. > > This looks on the right track to me. Thanks. > > > 0001 - change to ge

Re: partitioning and identity column

2023-12-21 Thread Peter Eisentraut
On 19.12.23 11:47, Ashutosh Bapat wrote: At this point I am looking for opinions on the above rules and whether the implementation is on the right track. This looks on the right track to me. 0001 - change to get_partition_ancestors() prologue. Can be reviewed and committed independent of othe

Re: partitioning and identity column

2023-11-16 Thread Ashutosh Bapat
On Mon, Nov 13, 2023 at 3:51 PM Peter Eisentraut wrote: > > On 27.10.23 13:32, Ashutosh Bapat wrote: > > I think we should fix these anomalies as follows > > 1. Allow identity columns to be added to the partitioned table > > irrespective of whether they have partitions of not. > > 2. Propagate ide

Re: partitioning and identity column

2023-11-13 Thread Peter Eisentraut
On 27.10.23 13:32, Ashutosh Bapat wrote: I think we should fix these anomalies as follows 1. Allow identity columns to be added to the partitioned table irrespective of whether they have partitions of not. 2. Propagate identity property to partitions. 3. Use the same underlying sequence for getti

partitioning and identity column

2023-10-27 Thread Ashutosh Bapat
Hi All, Reading [1] I have been experimenting with behaviour of identity columns and serial column in case of partitioned tables. My observations related to serial column can be found at [2]. This email is about identity column behaviour with partitioned tables. Serial and identity columns have suf