future-proofing relkind tests, take two

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: future-proofing relkind tests, take two
Date: 2010-12-30 06:44:41
Message-ID: AANLkTikkjUYxkhsZfVv2PbB-uEjos+hxhqD5Di33v_xL@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here's another attempt to reduce the number of places in the code that
need to be updated when adding a new relkind. It adds a few macros --
RELKIND_HAS_STORAGE(), RELKIND_HAS_SYSTEM_ATTS(), and
RELKIND_HAS_SYSTEM_GENERATED_ATTNAMES() and uses them in place of more
ad-hoc tests for the same conditions -- and it rewords a few
problematic messages (some of which are already slightly inaccurate)
so that they won't need updating when we add a new relkind for foreign
tables.

Thoughts? This is not a complete solution by any means, but I don't
think it makes anything worse (unless you hate the proposed wording, I
suppose) and it has the added benefit of simplifying the code in a few
places.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
future-proof-relkind.patch text/x-patch 17.2 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2010-12-30 07:02:51 Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
Previous Message Robert Haas 2010-12-30 05:57:45 Re: Avoiding rewrite in ALTER TABLE ALTER TYPE