Re: GetSubscriptionRelations declares too many scan keys

2021-05-12 Thread Peter Smith
On Wed, May 12, 2021 at 5:52 PM Michael Paquier wrote: > > On Tue, May 11, 2021 at 04:50:46PM +0900, Michael Paquier wrote: > > And that makes the code slightly easier to follow. > > Yeah, that's better this way, so applied. Thanks! -- Kind Regards, Peter Smith. Fujitsu Australia

Re: GetSubscriptionRelations declares too many scan keys

2021-05-12 Thread Michael Paquier
On Tue, May 11, 2021 at 04:50:46PM +0900, Michael Paquier wrote: > And that makes the code slightly easier to follow. Yeah, that's better this way, so applied. -- Michael signature.asc Description: PGP signature

Re: GetSubscriptionRelations declares too many scan keys

2021-05-11 Thread Michael Paquier
On Mon, May 10, 2021 at 10:14:08AM -0400, Tom Lane wrote: > Yeah, there's no real consensus about that. But in this case there's > a strong reason to use skey[1]: it makes the patch a very safe one-liner. > To convert to the other pattern would require touching more code. FWIW, what Peter S has d

Re: GetSubscriptionRelations declares too many scan keys

2021-05-10 Thread Tom Lane
Julien Rouhaud writes: > On Mon, May 10, 2021 at 07:09:29PM +1000, Peter Smith wrote: >> Please search PG source code for "ScanData skey[1];" - there are >> dozens of precedents where other people felt the same as me for >> declaring single keys. > AFAICT there are 73 occurences vs 62 of the "Sca

Re: GetSubscriptionRelations declares too many scan keys

2021-05-10 Thread Dilip Kumar
On Mon, May 10, 2021 at 2:46 PM Julien Rouhaud wrote: > > On Mon, May 10, 2021 at 07:09:29PM +1000, Peter Smith wrote: > > On Mon, May 10, 2021 at 6:09 PM Bharath Rupireddy > > wrote: > > > > > > On Mon, May 10, 2021 at 12:36 PM Peter Smith > > > wrote: > > > > > > > > The function GetSubscript

Re: GetSubscriptionRelations declares too many scan keys

2021-05-10 Thread Julien Rouhaud
On Mon, May 10, 2021 at 07:09:29PM +1000, Peter Smith wrote: > On Mon, May 10, 2021 at 6:09 PM Bharath Rupireddy > wrote: > > > > On Mon, May 10, 2021 at 12:36 PM Peter Smith wrote: > > > > > > The function GetSubscriptionRelations was declaring ScanKeyData > > > skey[2]; but actually > > > only

Re: GetSubscriptionRelations declares too many scan keys

2021-05-10 Thread Peter Smith
On Mon, May 10, 2021 at 6:09 PM Bharath Rupireddy wrote: > > On Mon, May 10, 2021 at 12:36 PM Peter Smith wrote: > > > > The function GetSubscriptionRelations was declaring ScanKeyData > > skey[2]; but actually > > only uses 1 scan key. It seems like the code was cut/paste from other > > nearby f

Re: GetSubscriptionRelations declares too many scan keys

2021-05-10 Thread Julien Rouhaud
On Mon, May 10, 2021 at 01:39:31PM +0530, Bharath Rupireddy wrote: > On Mon, May 10, 2021 at 12:36 PM Peter Smith wrote: > > > > The function GetSubscriptionRelations was declaring ScanKeyData > > skey[2]; but actually > > only uses 1 scan key. It seems like the code was cut/paste from other > > n

Re: GetSubscriptionRelations declares too many scan keys

2021-05-10 Thread Bharath Rupireddy
On Mon, May 10, 2021 at 12:36 PM Peter Smith wrote: > > The function GetSubscriptionRelations was declaring ScanKeyData > skey[2]; but actually > only uses 1 scan key. It seems like the code was cut/paste from other > nearby functions > which really are using 2 keys. > > PSA a trivial patch to dec

GetSubscriptionRelations declares too many scan keys

2021-05-10 Thread Peter Smith
The function GetSubscriptionRelations was declaring ScanKeyData skey[2]; but actually only uses 1 scan key. It seems like the code was cut/paste from other nearby functions which really are using 2 keys. PSA a trivial patch to declare the correct number of keys for this function. -- Kind Rega