Re: Make attstattarget nullable

2024-03-17 Thread Nathan Bossart
On Sun, Mar 17, 2024 at 01:51:39PM +0100, Peter Eisentraut wrote: > I have committed this patch series. Thanks. My compiler is worried that "newtarget" might be getting used uninitialized. AFAICT there's no actual risk here, so I think initializing it to 0 is sufficient. I'll commit the

Re: Make attstattarget nullable

2024-03-17 Thread Peter Eisentraut
On 14.03.24 15:46, Tomas Vondra wrote: 2) The newtarget handling in AlterStatistics seems rather confusing. Why does it get set to -1 just to ignore the value later? For a while I was 99% sure ALTER STATISTICS ... SET STATISTICS DEFAULT will set the field to -1. Maybe ditching the first if block

Re: Make attstattarget nullable

2024-03-14 Thread Tomas Vondra
On 3/14/24 11:13, Peter Eisentraut wrote: > On 12.03.24 14:32, Tomas Vondra wrote: >> On 3/12/24 13:47, Peter Eisentraut wrote: >>> On 06.03.24 22:34, Tomas Vondra wrote: 0001 1) I think this bit in ALTER STATISTICS docs is wrong: -  >>>

Re: Make attstattarget nullable

2024-03-14 Thread Peter Eisentraut
On 12.03.24 14:32, Tomas Vondra wrote: On 3/12/24 13:47, Peter Eisentraut wrote: On 06.03.24 22:34, Tomas Vondra wrote: 0001 1) I think this bit in ALTER STATISTICS docs is wrong: -  new_target +  SET STATISTICS { integer | DEFAULT } because it means we now have list entries

Re: Make attstattarget nullable

2024-03-12 Thread Tomas Vondra
On 3/12/24 13:47, Peter Eisentraut wrote: > On 06.03.24 22:34, Tomas Vondra wrote: >> 0001 >> >> >> 1) I think this bit in ALTER STATISTICS docs is wrong: >> >> -  > class="parameter">new_target >> +  SET STATISTICS { > class="parameter">integer | DEFAULT } >> >> because it means

Re: Make attstattarget nullable

2024-03-12 Thread Peter Eisentraut
On 06.03.24 22:34, Tomas Vondra wrote: 0001 1) I think this bit in ALTER STATISTICS docs is wrong: - new_target + SET STATISTICS { integer | DEFAULT } because it means we now have list entries for name, ..., new_name, new_schema, and then suddenly "SET STATISTICS { integer |

Re: Make attstattarget nullable

2024-03-06 Thread Tomas Vondra
Hi Peter, I took a look at this patch today. I think it makes sense to do this, and I haven't found any major issues with any of the three patches. A couple minor comments: 0001 1) I think this bit in ALTER STATISTICS docs is wrong: - new_target + SET STATISTICS { integer |

Re: Make attstattarget nullable

2024-01-15 Thread Peter Eisentraut
On 12.01.24 12:16, Alvaro Herrera wrote: In get_attstattarget() I think we should return 0 for dropped columns without reading attstattarget, which is useless anyway, and if it did happen to return non-null, it might cause us to do stuff, which would be a waste. I ended up deciding to get rid

Re: Make attstattarget nullable

2024-01-12 Thread Alvaro Herrera
BTW I wanted to but didn't say so explicitly, so here goes: 0001 looks ready to go in. -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/ "Find a bug in a program, and fix it, and the program will work today. Show the program how to find and fix a bug, and the

Re: Make attstattarget nullable

2024-01-12 Thread Alvaro Herrera
On 2024-Jan-11, Peter Eisentraut wrote: > On 10.01.24 14:16, Alvaro Herrera wrote: > > Seems reasonable. Do we really need a catversion bump for this? > > Yes, this changes the order of the fields in pg_attribute. Ah, right. > > In get_attstattarget() I think we should return 0 for dropped

Re: Make attstattarget nullable

2024-01-11 Thread Peter Eisentraut
On 10.01.24 14:16, Alvaro Herrera wrote: Here is an updated patch rebased over 3e2e0d5ad7. The 0001 patch stands on its own, but I also tacked on two additional WIP patches that simplify some pg_attribute handling and make these kinds of refactorings simpler in the future. See description in

Re: Make attstattarget nullable

2024-01-10 Thread Alvaro Herrera
On 2023-Dec-23, Peter Eisentraut wrote: > Here is an updated patch rebased over 3e2e0d5ad7. > > The 0001 patch stands on its own, but I also tacked on two additional WIP > patches that simplify some pg_attribute handling and make these kinds of > refactorings simpler in the future. See

Re: Make attstattarget nullable

2023-12-23 Thread Peter Eisentraut
Here is an updated patch rebased over 3e2e0d5ad7. The 0001 patch stands on its own, but I also tacked on two additional WIP patches that simplify some pg_attribute handling and make these kinds of refactorings simpler in the future. See description in the patches. On 05.12.23 13:52, Peter