Re: tablecmds.c/MergeAttributes() cleanup

2024-05-03 Thread Ashutosh Bapat
On Fri, May 3, 2024 at 2:47 PM Peter Eisentraut wrote: > On 30.04.24 21:48, Robert Haas wrote: > > I took a look at this patch. Currently this case crashes: > > > > CREATE TABLE cmdata(f1 text COMPRESSION pglz); > > CREATE TABLE cmdata3(f1 text); > > CREATE TABLE cminh() INHERITS (cmdata,

Re: tablecmds.c/MergeAttributes() cleanup

2024-05-03 Thread Peter Eisentraut
On 30.04.24 21:48, Robert Haas wrote: I took a look at this patch. Currently this case crashes: CREATE TABLE cmdata(f1 text COMPRESSION pglz); CREATE TABLE cmdata3(f1 text); CREATE TABLE cminh() INHERITS (cmdata, cmdata3); The patch makes this succeed, but I was initially unclear why it didn't

Re: tablecmds.c/MergeAttributes() cleanup

2024-04-30 Thread Robert Haas
On Tue, Apr 30, 2024 at 2:19 AM Ashutosh Bapat wrote: > On Mon, Apr 29, 2024 at 6:46 PM Robert Haas wrote: >> On Sat, Apr 20, 2024 at 12:17 AM Ashutosh Bapat >> wrote: >> > Yes please. Probably this issue surfaced again after we reverted >> > compression and storage fix? Please If that's the

Re: tablecmds.c/MergeAttributes() cleanup

2024-04-30 Thread Ashutosh Bapat
On Mon, Apr 29, 2024 at 6:46 PM Robert Haas wrote: > On Sat, Apr 20, 2024 at 12:17 AM Ashutosh Bapat > wrote: > > Yes please. Probably this issue surfaced again after we reverted > compression and storage fix? Please If that's the case, please add it to > the open items. > > This is still on

Re: tablecmds.c/MergeAttributes() cleanup

2024-04-29 Thread Robert Haas
On Sat, Apr 20, 2024 at 12:17 AM Ashutosh Bapat wrote: > Yes please. Probably this issue surfaced again after we reverted compression > and storage fix? Please If that's the case, please add it to the open items. This is still on the open items list and I'm not clear who, if anyone, is working

Re: tablecmds.c/MergeAttributes() cleanup

2024-04-19 Thread Ashutosh Bapat
On Sat, Apr 20, 2024 at 9:30 AM Alexander Lakhin wrote: > Hello, > > 30.01.2024 09:22, Ashutosh Bapat wrote: > > > >> Please look at the segmentation fault triggered by the following query > since > >> 4d969b2f8: > >> CREATE TABLE t1(a text COMPRESSION pglz); > >> CREATE TABLE t2(a text); > >>

Re: tablecmds.c/MergeAttributes() cleanup

2024-04-19 Thread Alexander Lakhin
Hello, 30.01.2024 09:22, Ashutosh Bapat wrote: Please look at the segmentation fault triggered by the following query since 4d969b2f8: CREATE TABLE t1(a text COMPRESSION pglz); CREATE TABLE t2(a text); CREATE TABLE t3() INHERITS(t1, t2); NOTICE: merging multiple inherited definitions of

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-29 Thread Ashutosh Bapat
Hi Alexander, On Sun, Jan 28, 2024 at 1:30 PM Alexander Lakhin wrote: > > Hello Peter, > > 26.01.2024 16:42, Peter Eisentraut wrote: > > > > I have committed all this. These are great improvements. > > > > Please look at the segmentation fault triggered by the following query since > 4d969b2f8:

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-28 Thread Alexander Lakhin
Hello Peter, 26.01.2024 16:42, Peter Eisentraut wrote: I have committed all this.  These are great improvements. Please look at the segmentation fault triggered by the following query since 4d969b2f8: CREATE TABLE t1(a text COMPRESSION pglz); CREATE TABLE t2(a text); CREATE TABLE t3()

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-26 Thread Peter Eisentraut
On 24.01.24 07:27, Ashutosh Bapat wrote: While working on identity support and now while looking at the compression problem you referred to, I found MergeAttribute() to be hard to read. It's hard to follow high level logic in that function since the function is not modular. I took a stab at

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-23 Thread Ashutosh Bapat
Hi Peter, On Mon, Jan 22, 2024 at 6:13 PM Peter Eisentraut wrote: > > On 06.12.23 09:23, Peter Eisentraut wrote: > > The (now) second patch is also still of interest to me, but I have since > > noticed that I think [0] should be fixed first, but to make that fix > > simpler, I would like the

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-22 Thread Peter Eisentraut
On 06.12.23 09:23, Peter Eisentraut wrote: The (now) second patch is also still of interest to me, but I have since noticed that I think [0] should be fixed first, but to make that fix simpler, I would like the first patch from here. [0]:

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-12 Thread Robert Haas
On Fri, Jan 12, 2024 at 10:09 AM Robert Haas wrote: > Open-coding stuff like this can easily work out to a loss, and I > personally think we're overly dependent on List. It's not a > particularly good abstraction, IMHO, and if we do a lot of work to > start using it everywhere because a list is

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-12 Thread Tom Lane
Robert Haas writes: > On Fri, Jan 12, 2024 at 5:32 AM Alvaro Herrera > wrote: >> In addition, it also occurs to me now that maybe it would make sense to >> change the TupleDesc implementation to use a List of Form_pg_attribute >> instead of an array, and do away with ->natts. This would let us

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-12 Thread Robert Haas
On Fri, Jan 12, 2024 at 5:32 AM Alvaro Herrera wrote: > On 2024-Jan-11, Alvaro Herrera wrote: > > If you look closely at InsertPgAttributeTuples and accompanying code, it > > all looks a bit archaic. They seem to be treating TupleDesc as a > > glorified array of Form_pg_attribute elements in a

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-12 Thread Alvaro Herrera
On 2024-Jan-11, Alvaro Herrera wrote: > If you look closely at InsertPgAttributeTuples and accompanying code, it > all looks a bit archaic. They seem to be treating TupleDesc as a > glorified array of Form_pg_attribute elements in a convenient packaging. > It's probably cleaner to change these

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-11 Thread Alvaro Herrera
On 2023-Dec-06, Peter Eisentraut wrote: > One of your (Álvaro's) comments about this earlier was > > > Hmm, crazy. I'm not sure I like this, because it seems much too clever. > > The number of lines that are deleted is alluring, though. > > > > Maybe it'd be better to create a separate routine

Re: tablecmds.c/MergeAttributes() cleanup

2023-12-06 Thread Peter Eisentraut
On 05.10.23 17:49, Peter Eisentraut wrote: On 19.09.23 15:11, Peter Eisentraut wrote: Here is an updated version of this patch set.  I resolved some conflicts and addressed this comment of yours.  I also dropped the one patch with some catalog header edits that people didn't seem to

Re: tablecmds.c/MergeAttributes() cleanup

2023-10-05 Thread Peter Eisentraut
On 19.09.23 15:11, Peter Eisentraut wrote: Here is an updated version of this patch set.  I resolved some conflicts and addressed this comment of yours.  I also dropped the one patch with some catalog header edits that people didn't seem to particularly like. The patches that are now 0001

Re: tablecmds.c/MergeAttributes() cleanup

2023-09-19 Thread Peter Eisentraut
On 29.08.23 13:20, Alvaro Herrera wrote: On 2023-Aug-29, Peter Eisentraut wrote: @@ -3278,13 +3261,16 @@ MergeAttributes(List *schema, List *supers, char relpersistence, * * constraints is a list of CookedConstraint structs for previous constraints. * - * Returns true if merged

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-30 Thread Alvaro Herrera
On 2023-Aug-29, Nathan Bossart wrote: > On Tue, Aug 29, 2023 at 08:44:02PM +0200, Alvaro Herrera wrote: > > Makes sense. However, maybe we should replace those ugly defines and > > their hardcoded values in DefineSequence with a proper array with their > > names and datatypes. > > That might

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-30 Thread Peter Eisentraut
On 29.08.23 19:45, Nathan Bossart wrote: On Tue, Aug 29, 2023 at 10:43:39AM +0200, Peter Eisentraut wrote: I have committed a few more patches from this series that were already agreed upon. The remaining ones are rebased and reordered a bit, attached. My compiler is complaining about

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Nathan Bossart
On Tue, Aug 29, 2023 at 08:44:02PM +0200, Alvaro Herrera wrote: > On 2023-Aug-29, Nathan Bossart wrote: >> My compiler is complaining about 1fa9241b: >> >> ../postgresql/src/backend/commands/sequence.c: In function ‘DefineSequence’: >> ../postgresql/src/backend/commands/sequence.c:196:21: error:

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Nathan Bossart wrote: > On Tue, Aug 29, 2023 at 10:43:39AM +0200, Peter Eisentraut wrote: > > I have committed a few more patches from this series that were already > > agreed upon. The remaining ones are rebased and reordered a bit, attached. > > My compiler is complaining

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Nathan Bossart
On Tue, Aug 29, 2023 at 10:43:39AM +0200, Peter Eisentraut wrote: > I have committed a few more patches from this series that were already > agreed upon. The remaining ones are rebased and reordered a bit, attached. My compiler is complaining about 1fa9241b:

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Peter Eisentraut wrote: > From 471fda80c41fae835ecbe63ae8505526a37487a9 Mon Sep 17 00:00:00 2001 > From: Peter Eisentraut > Date: Wed, 12 Jul 2023 16:12:35 +0200 > Subject: [PATCH v2 04/10] Add TupleDescGetDefault() > > This unifies some repetitive code. > > Note: I didn't push

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Peter Eisentraut wrote: Regarding this hunk in 0002, > @@ -3278,13 +3261,16 @@ MergeAttributes(List *schema, List *supers, char > relpersistence, > * > * constraints is a list of CookedConstraint structs for previous > constraints. > * > - * Returns true if merged

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Peter Eisentraut
On 12.07.23 16:29, Peter Eisentraut wrote: On 11.07.23 20:17, Alvaro Herrera wrote: I spent a few minutes doing a test merge of this to my branch with NOT NULL changes.  Here's a quick review. Subject: [PATCH 01/17] Remove obsolete comment about OID support Obvious, trivial.  +1 Subject:

Re: tablecmds.c/MergeAttributes() cleanup

2023-07-12 Thread Peter Eisentraut
On 11.07.23 20:17, Alvaro Herrera wrote: I spent a few minutes doing a test merge of this to my branch with NOT NULL changes. Here's a quick review. Subject: [PATCH 01/17] Remove obsolete comment about OID support Obvious, trivial. +1 Subject: [PATCH 02/17] Remove ancient special case

Re: tablecmds.c/MergeAttributes() cleanup

2023-07-11 Thread Alvaro Herrera
On 2023-Jun-28, Peter Eisentraut wrote: > The MergeAttributes() and related code in and around tablecmds.c is huge and > ancient, with many things bolted on over time, and difficult to deal with. > I took some time to make careful incremental updates and refactorings to > make the code easier to

Re: tablecmds.c/MergeAttributes() cleanup

2023-06-29 Thread Alvaro Herrera
On 2023-Jun-28, Peter Eisentraut wrote: > The MergeAttributes() and related code in and around tablecmds.c is huge and > ancient, with many things bolted on over time, and difficult to deal with. > I took some time to make careful incremental updates and refactorings to > make the code easier to