Re: help with rules for system table

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: rlhsiao(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: help with rules for system table
Date: 2006-01-10 20:36:29
Message-ID: 20060110203629.GG3902@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jan 08, 2006 at 06:35:06PM -0800, rlhsiao(at)gmail(dot)com wrote:
> Hi,
>
> I have to archieve functions like this:
> When users define a new index, I will do something (for instance,
> increase an counter in my table or do some other statistics). However,
> I defined rule for insert on pg_class and when the entry is actually an
> index, I do my thing. Obviously my rule is never executed. If I create
> a similar rule for a table I defined, it works. Does this mean that I
> can't create rules for system tables? If not, does anyone know how to
> do this?

Many system operations completely bypass the 'normal' access methods for
touching the system tables, so generally you can't do things like
triggers or rules.

Depending on what you need to do there may be other ways to accomplish
it, though. For example, it's trivial to get a count of indexes on a
table...
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Sabino Mullane 2006-01-10 20:42:31 Re: E-mail harvesting on PG lists?
Previous Message Jim C. Nasby 2006-01-10 20:34:19 Re: PostgreSQL Arrays and Performance