Re: Towards easier AMs: Cleaning up inappropriate use of name "relkind"

From: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Towards easier AMs: Cleaning up inappropriate use of name "relkind"
Date: 2020-07-02 00:04:19
Message-ID: 5CA53A5E-5070-432D-987C-E6AB52E2A411@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Jun 3, 2020, at 10:05 AM, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com> wrote:
>
> I have another patch (to be posted shortly) that cleans up the #define RELKIND_XXX stuff using a new RelKind enum and special macros while keeping the relkind fields as type 'char'. Along with converting code to use switch(relkind) rather than if (relkind...) statements, the compiler now warns on unhandled cases when you add a new RelKind to the list, making it easier to find all the places you need to update. I decided to keep that work independent of this patch, as the code is logically distinct.

Most of the work in this patch is mechanical replacement of if/else if/else statements which hinge on relkind to switch statements on relkind. The patch is not philosophically very interesting, but it is fairly long. Reviewers might start by scrolling down the patch to the changes in src/include/catalog/pg_class.h

There are no intentional behavioral changes in this patch.

Attachment Content-Type Size
v2-0002-Refactoring-relkind-handling.patch application/octet-stream 521.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message michael 2020-07-02 01:38:45 Re: min_safe_lsn column in pg_replication_slots view
Previous Message Tom Lane 2020-07-01 23:54:11 Re: SQL-standard function body