Re: iterating over relation's attributes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: iterating over relation's attributes
Date: 2007-05-06 00:13:35
Message-ID: 29387.1178410415@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Tom Lane wrote:
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>> What is the approved way to iterate over a relation's attributes?
>>
>> Most places scan through the relation's tuple descriptor, rather
>> than expending multiple catalog lookups in pg_attribute.

> Doesn't that require me to open the relation? Is that a good thing if I
> wouldn't otherwise be doing that?

Sure, because whatever work gets done is likely to be amortized across
multiple uses of the relcache entry anyway.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-05-06 00:52:02 Re: Integer datetimes
Previous Message Jim Nasby 2007-05-05 22:23:18 Re: temporal variants of generate_series()