RE: Planned changes to pg_am catalog

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Planned changes to pg_am catalog
Date: 2001-07-16 01:55:07
Message-ID: ECEHIKNFIMMECLEBJFIGGEEHCBAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Note that this doesn't address Oleg's concerns about haskeytype,
> lossiness, etc. AFAICS those issues are not related to the contents
> of pg_am. Later on, I am going to have some proposals for altering
> pg_opclass and related tables to deal with those issues...
>
> Comments? Any other festering problems in this immediate area?

As part of my DROP CONSTRAINT stuff I've been fiddling with, I've found it
necessary to write an 'IsIndex' function. At the moment, all it does is
return true if the named index exists on the named relation and is unique
(or primary, or neither, or any).

I think it would be very nice to have an all-purpose function with a
definition something like this:

bool IsIndex(Relation rel, const char *indname, int type, List attrs);

Where type could be:

0 - any
1 - normal
2 - unique
3 - primary

And attrs, if not null, indicates that true should only be returned if the
index is over the given list of attributes (in the given order).

I guess the function would assume that the necessary lock is acquired on the
relation from outside the function.

I think there's _lots_ of places in the code where index existence checks
are performed and this could prevent vast code-duplication...

Chris

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sanath Peiris 2001-07-16 04:13:23 PGSQL problem with weblogic and OID data type
Previous Message Larry Rosenman 2001-07-16 01:13:48 Re: iconv?