Re: removing unnecessary get_att*() lsyscache functions

2018-10-23 Thread Peter Eisentraut
On 23/10/2018 02:11, Michael Paquier wrote: > On Mon, Oct 22, 2018 at 07:12:28PM +0200, Peter Eisentraut wrote: >> OK, slightly reworked version attached. > > + attTup = (Form_pg_attribute) GETSTRUCT(tuple); > attnum = ((Form_pg_attribute) GETSTRUCT(tuple))->attnum; > > No need to call

Re: removing unnecessary get_att*() lsyscache functions

2018-10-22 Thread Andres Freund
Hi, On 2018-10-23 09:11:17 +0900, Michael Paquier wrote: > On Mon, Oct 22, 2018 at 07:12:28PM +0200, Peter Eisentraut wrote: > > OK, slightly reworked version attached. > > + attTup = (Form_pg_attribute) GETSTRUCT(tuple); > attnum = ((Form_pg_attribute) GETSTRUCT(tuple))->attnum; > > No

Re: removing unnecessary get_att*() lsyscache functions

2018-10-22 Thread Michael Paquier
On Mon, Oct 22, 2018 at 07:12:28PM +0200, Peter Eisentraut wrote: > OK, slightly reworked version attached. + attTup = (Form_pg_attribute) GETSTRUCT(tuple); attnum = ((Form_pg_attribute) GETSTRUCT(tuple))->attnum; No need to call twice GETSTRUCT here.. The rest looks fine. -- Michael

Re: removing unnecessary get_att*() lsyscache functions

2018-10-22 Thread Peter Eisentraut
On 19/10/2018 16:00, Michael Paquier wrote: >> - if (get_attidentity(RelationGetRelid(rel), attnum)) >> + if (TupleDescAttr(RelationGetDescr(rel), attnum - 1)->attidentity) > I find this style heavy, saving Form_pg_attribute into a different > variable would be more readable in my

Re: removing unnecessary get_att*() lsyscache functions

2018-10-19 Thread Michael Paquier
On Thu, Oct 18, 2018 at 09:57:00PM +0200, Peter Eisentraut wrote: > I noticed that get_attidentity() isn't really necessary because the > information can be obtained from an existing tuple descriptor in each > case. This one is also recent, so it looks fine to remove it. > Also, get_atttypmod()

removing unnecessary get_att*() lsyscache functions

2018-10-18 Thread Peter Eisentraut
I noticed that get_attidentity() isn't really necessary because the information can be obtained from an existing tuple descriptor in each case. Also, get_atttypmod() hasn't been used since 2004. I propose the attached patches to remove these two functions. -- Peter Eisentraut