Re: Use an enum for RELKIND_*?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Use an enum for RELKIND_*?
Дата
Msg-id 201901161710.wvm7nayw5xcv@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Use an enum for RELKIND_*?  (Greg Stark <stark@mit.edu>)
Ответы Re: Use an enum for RELKIND_*?  (Greg Stark <stark@mit.edu>)
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] generated columns
Следующее
От: John Naylor
Дата:
Сообщение: Re: WIP: Avoid creation of the free space map for small tables