RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2021-04-01 Thread tsunakawa.ta...@fujitsu.com
From: Bharath Rupireddy > Attaching a small patch that emits a warning when the persistence setting of a > partitioned table is changed and also added a note into the docs. Please have > a > look at it. Thank you. However, I think I'll withdraw this CF entry since I'm not sure I can take time

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2021-04-01 Thread Bharath Rupireddy
On Thu, Mar 25, 2021 at 10:21 PM David Steele wrote: > This thread seems to be stalled. Since it represents a bug fix is there > something we can do in the meantime while a real solution is worked out? > > Perhaps just inform the user that nothing was done? Or get something > into the documentatio

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2021-03-25 Thread David Steele
On 1/27/21 1:00 AM, Kyotaro Horiguchi wrote: At Wed, 27 Jan 2021 05:30:29 +, "tsunakawa.ta...@fujitsu.com" wrote in From: Kyotaro Horiguchi "CREATE TABLE" is not "CREATE LOGGED TABLE". We can assume that as "CREATE TABLE", where the default logged-ness varies according to context. Or it

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2021-01-26 Thread Kyotaro Horiguchi
At Wed, 27 Jan 2021 05:30:29 +, "tsunakawa.ta...@fujitsu.com" wrote in > From: Kyotaro Horiguchi > > "CREATE TABLE" is not "CREATE LOGGED TABLE". We can assume that as > > "CREATE TABLE", where the default logged-ness > > varies according to context. Or it might have been so since the begi

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2021-01-26 Thread tsunakawa.ta...@fujitsu.com
From: Kyotaro Horiguchi > "CREATE TABLE" is not "CREATE LOGGED TABLE". We can assume that as > "CREATE TABLE", where the default logged-ness > varies according to context. Or it might have been so since the beginning. > Currently we don't have the syntax "CREATE LOGGED TABLE", but we can add > th

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2021-01-25 Thread Kyotaro Horiguchi
At Sat, 26 Dec 2020 01:56:02 +, "tsunakawa.ta...@fujitsu.com" wrote in > From: Michael Paquier > > On Wed, Dec 09, 2020 at 09:52:17AM -0300, Alvaro Herrera wrote: > > > Well, that definition seems unfriendly to me. I prefer the stance > > > that if you change the value for the parent, then

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-25 Thread tsunakawa.ta...@fujitsu.com
From: Michael Paquier > On Wed, Dec 09, 2020 at 09:52:17AM -0300, Alvaro Herrera wrote: > > Well, that definition seems unfriendly to me. I prefer the stance > > that if you change the value for the parent, then future partitions > > inherit that value. > > That's indeed more interesting from th

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-24 Thread Michael Paquier
On Wed, Dec 09, 2020 at 10:56:45AM -0300, Alvaro Herrera wrote: > Sounds good. I think this thread is a good place to collect those > patches, but if you would prefer to have a new thread, feel free to > start one (I'd suggest CC'ing me and Tsunakawa-san). There is an entry listed in the CF for t

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-24 Thread Michael Paquier
On Wed, Dec 09, 2020 at 09:52:17AM -0300, Alvaro Herrera wrote: > On 2020-Dec-09, tsunakawa.ta...@fujitsu.com wrote: >> The new partition will have a property specified when the user creates >> it. That is, while the storage property of each storage unit >> (=partition) is basically independent, A

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-09 Thread tsunakawa.ta...@fujitsu.com
From: Bharath Rupireddy > I'm not sure how many more of such commands exist which require changes. > > How about doing it this way? > > 1) Have a separate common thread listing the commands and specifying > clearly the agreed behaviour for such commands. > 2) Whenever the separate patches are su

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-09 Thread tsunakawa.ta...@fujitsu.com
From: Alvaro Herrera > Well, that definition seems unfriendly to me. I prefer the stance that > if you change the value for the parent, then future partitions inherit > that value. That would be right when the storage property is an optional specification such as fillfactor. For example, when

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-09 Thread Alvaro Herrera
On 2020-Dec-09, Bharath Rupireddy wrote: > I'm not sure how many more of such commands exist which require changes. The other thread has a list. I think it is complete, but if you want to double-check, that would be helpful. > How about doing it this way? > > 1) Have a separate common thread l

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-09 Thread Bharath Rupireddy
On Wed, Dec 9, 2020 at 6:22 PM Alvaro Herrera wrote: > > On 2020-Dec-09, tsunakawa.ta...@fujitsu.com wrote: > > > From: Alvaro Herrera > > > But what happens when you create another partition after you change the > > > "loggedness" of the partitioned table? > > > > The new partition will have a p

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-09 Thread Alvaro Herrera
On 2020-Dec-09, tsunakawa.ta...@fujitsu.com wrote: > From: Alvaro Herrera > > But what happens when you create another partition after you change the > > "loggedness" of the partitioned table? > > The new partition will have a property specified when the user creates > it. That is, while the st

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-08 Thread tsunakawa.ta...@fujitsu.com
From: Alvaro Herrera > But what happens when you create another partition after you change the > "loggedness" of the partitioned table? The new partition will have a property specified when the user creates it. That is, while the storage property of each storage unit (=partition) is basically

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-08 Thread Alvaro Herrera
On 2020-Dec-08, tsunakawa.ta...@fujitsu.com wrote: > From: Alvaro Herrera > > Does "ALTER TABLE ONLY parent" work correctly? Namely, do not affect > > existing partitions, but cause future partitions to acquire the new > > setting. > > Yes, it works correctly in the sense that ALTER TABLE ONLY

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-07 Thread tsunakawa.ta...@fujitsu.com
From: Alvaro Herrera > Does "ALTER TABLE ONLY parent" work correctly? Namely, do not affect > existing partitions, but cause future partitions to acquire the new > setting. Yes, it works correctly in the sense that ALTER TABLE ONLY on a partitioned table does nothing because it has no storage a

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-07 Thread tsunakawa.ta...@fujitsu.com
From: Bharath Rupireddy > Do you mean to say that if we detach all the partitions(assuming they > are all unlogged) then the parent table(assuming logged) gets changed > to unlogged? Does it happen on master? Am I missing something here? No, the parent remains logged in that case both on master a

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-07 Thread Alvaro Herrera
Does "ALTER TABLE ONLY parent" work correctly? Namely, do not affect existing partitions, but cause future partitions to acquire the new setting. This sounds very much related to previous discussion on REPLICA IDENTITY not propagating to partitions; see https://postgr.es/m/201902041630.gpadougzab

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-07 Thread Bharath Rupireddy
On Mon, Dec 7, 2020 at 11:36 AM tsunakawa.ta...@fujitsu.com wrote: > > From: Bharath Rupireddy > > IMHO, we should also change the parent table. Say, I have 2 local > > partitions for a logged table, then I alter that table to > > unlogged(with your patch, parent table doesn't become unlogged whe

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-06 Thread tsunakawa.ta...@fujitsu.com
From: Bharath Rupireddy > IMHO, we should also change the parent table. Say, I have 2 local > partitions for a logged table, then I alter that table to > unlogged(with your patch, parent table doesn't become unlogged whereas > the partitions will), and I detach all the partitions for some reason.

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-04 Thread Bharath Rupireddy
On Fri, Dec 4, 2020 at 8:22 AM tsunakawa.ta...@fujitsu.com wrote: > > From: Bharath Rupireddy > > 1) What happens if a partitioned table has a foreign partition along > > with few other local partitions[1]? Currently, if we try to set > > logged/unlogged of a foreign table, then an "ERROR: "

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-03 Thread Bharath Rupireddy
On Fri, Dec 4, 2020 at 8:22 AM tsunakawa.ta...@fujitsu.com wrote: > > From: Bharath Rupireddy > > 1) What happens if a partitioned table has a foreign partition along > > with few other local partitions[1]? Currently, if we try to set > > logged/unlogged of a foreign table, then an "ERROR: "

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-03 Thread tsunakawa.ta...@fujitsu.com
From: Bharath Rupireddy > 1) What happens if a partitioned table has a foreign partition along > with few other local partitions[1]? Currently, if we try to set > logged/unlogged of a foreign table, then an "ERROR: "" is not a > table" is thrown. This makes sense. With your patch also we see

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-02 Thread Bharath Rupireddy
On Wed, Dec 2, 2020 at 3:57 PM Bharath Rupireddy wrote: > > On Wed, Dec 2, 2020 at 1:52 PM tsunakawa.ta...@fujitsu.com > wrote: > > > > ALTER TABLE SET LOGGED/UNLOGED on a partitioned table completes > > successfully, but nothing changes. > > > > Yeah, true. > > > > > I expected the underlying p

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-02 Thread Bharath Rupireddy
On Wed, Dec 2, 2020 at 1:52 PM tsunakawa.ta...@fujitsu.com wrote: > > ALTER TABLE SET LOGGED/UNLOGED on a partitioned table completes successfully, > but nothing changes. > Yeah, true. > > I expected the underlying partitions are changed accordingly. The attached > patch fixes this. > My tho

[bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-02 Thread tsunakawa.ta...@fujitsu.com
Hello, ALTER TABLE SET LOGGED/UNLOGED on a partitioned table completes successfully, but nothing changes. I expected the underlying partitions are changed accordingly. The attached patch fixes this. Regards Takayuki Tsunakawa v1-0001-Make-ALTER-TABLE-SET-LOGGED-UNLOGGED-on-a-partiti.pat