Re: Use an enum for RELKIND_*?

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: Use an enum for RELKIND_*?
Date: 2019-01-16 17:10:07
Message-ID: 201901161710.wvm7nayw5xcv@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Dec-21, Greg Stark wrote:

> But I had a second look to see if the output pointed out any actual
> bugs. I found one though it's pretty minor:
>
> lockfuncs.c:234:3: warning: enumeration value
> ‘LOCKTAG_SPECULATIVE_TOKEN’ not handled in switch [-Wswitch-enum]
> switch ((LockTagType) instance->locktag.locktag_type)
> ^~~~~~
>
> It just causes speculative locks to be printed wrong in the
> pg_lock_status view.

So what's a good fix? We can add a new case to the switch. Reporting
the XID is easy since we have a column for that, but what to do about
the uint32 value of the token? We could put it in the virtualxid column
(which is just text), or we could put it in some int32 column and let it
show as negative; or we could add a new column.

Or we could do nothing, since there are no complaints about this
problem.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2019-01-16 17:14:49 Re: WIP: Avoid creation of the free space map for small tables
Previous Message Robert Haas 2019-01-16 17:02:35 Re: [HACKERS] generated columns