Re: removing unnecessary get_att*() lsyscache functions

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: removing unnecessary get_att*() lsyscache functions
Date: 2018-10-19 14:00:47
Message-ID: 20181019140047.GH2099@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-10-19 14:07:31 Re: WAL archive (archive_mode = always) ?
Previous Message Andrew Dunstan 2018-10-19 14:00:43 Re: lowering pg_regress privileges on Windows