Re: removing unnecessary get_att*() lsyscache functions - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: removing unnecessary get_att*() lsyscache functions
Date
Msg-id 20181019140047.GH2099@paquier.xyz
Whole thread Raw
In response to removing unnecessary get_att*() lsyscache functions  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: removing unnecessary get_att*() lsyscache functions
List pgsql-hackers
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() hasn't been used since 2004.

github is not actually reporting areas where this is used.

> I propose the attached patches to remove these two functions.

> -     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 opinion..
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: lowering pg_regress privileges on Windows
Next
From: Michael Paquier
Date:
Subject: Re: WAL archive (archive_mode = always) ?