Re: pg_class.relistemp

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Pg Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_class.relistemp
Date: 2011-07-14 16:57:03
Message-ID: 4E1ED98F020000250003F331@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)com> wrote:
> On Jul 13, 2011, at 12:57 PM, Kevin Grittner wrote:
>
>> create or replace function relistemp(rel pg_class)
>> returns boolean language sql immutable strict as
>> $$select $1.relpersistence = 't';$$;
>>
>> Just don't forget to use the table name or alias in front of
>> it... :-)
>
> Oh, nice hack. How far back does that work (pgTAP runs on 8.0 and
> higher)?

As far as I know, the technique of creating a function with a record
type as its only parameter to use as a "generated column" goes way
back. This particular function won't work prior to 9.1, because you
won't have the relpersistence column, but then, prior to 9.1 you
wouldn't need to run this because you already have a relistemp
column.

-Kevin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2011-07-14 16:59:05 Re: pg_class.relistemp
Previous Message Heikki Linnakangas 2011-07-14 16:55:22 Re: pg_class.relistemp