Re: get_rel_* functions in lsyscache.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jaime Casanova <systemguards(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: get_rel_* functions in lsyscache.c
Date: 2005-06-25 14:40:02
Message-ID: 21246.1119710402@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jaime Casanova <systemguards(at)gmail(dot)com> writes:
> Hi, i have a doubt...
> it seems to me that the get_rel_* functions in lsyscache do the same as doing
> heap_open();
> Calling the appropiate macro Relation*
> heap_close();

> is there any difference between them? in wich situation is one better
> than the other?

The lsyscache functions are just notational convenience --- they're
shorter to write and easier to read than accessing the underlying
catalog entries for yourself. However, I'd usually only use them
to pull one or two items from a given catalog entries; if I need
several fields from the same catalog entry, I'd open the catalog
entry just once and grab the fields directly, to avoid multiple
cache searches.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-06-25 15:04:16 Re: Add PG version number to NLS files
Previous Message Tom Lane 2005-06-25 14:27:31 Re: Add PG version number to NLS files