Use an enum for RELKIND_*? - Mailing list pgsql-hackers

From Andres Freund
Subject Use an enum for RELKIND_*?
Date
Msg-id 20181219011308.mopzyvc73nwjzdb6@alap3.anarazel.de
Whole thread Raw
Responses Re: Use an enum for RELKIND_*?  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
Hi,

Right now there's no easy way to use the compiler to ensure that all
places that need to deal with all kinds of relkinds check a new
relkind.  I think we should make that easier by moving RELKIND_* to an
enum, with the existing letters as the value.

Obviously we cannot really do that for FormData_pg_class.relkind, but
switch() statements can easily cast that to RelationRelkind (or whatever
we name it).

Does anybody see a reason not to do so?

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: cfbot run pgindent?
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Use an enum for RELKIND_*?