Re: Use LOCKMODE in parse_relation.c/.h
От
Peter Eisentraut
Тема
Re: Use LOCKMODE in parse_relation.c/.h
Дата
Msg-id
4312ef46-2c4e-4700-a502-886d200605fa@eisentraut.org
Ответ на
Re: Use LOCKMODE in parse_relation.c/.h (Andreas Karlsson)
Список
Дерево обсуждения
Use LOCKMODE in parse_relation.c/.h Peter Eisentraut <peter@eisentraut.org>
Re: Use LOCKMODE in parse_relation.c/.h Andreas Karlsson <andreas@proxel.se>
Re: Use LOCKMODE in parse_relation.c/.h Peter Eisentraut <peter@eisentraut.org>
Re: Use LOCKMODE in parse_relation.c/.h Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: Use LOCKMODE in parse_relation.c/.h Peter Eisentraut <peter@eisentraut.org>
On 18.02.26 18:19, Andreas Karlsson wrote: > On 2/18/26 10:50 AM, Peter Eisentraut wrote: >> There are a couple of comments in parse_relation.c >> >> > Note: properly, lockmode should be declared LOCKMODE not int, but that >> > would require importing storage/lock.h into parse_relation.h. Since >> > LOCKMODE is typedef'd as int anyway, that seems like overkill. >> >> but actually LOCKMODE has been in storage/lockdefs.h for a while, >> which is intentionally a more narrow header. So we can include that >> one in parse_relation.h and just use LOCKMODE normally. >> >> An alternative would be to add a duplicate typedef into >> parse_relation.h, but that doesn't seem necessary here. > > Looks like a nice change and I did not find any more cases where we > should fix this. > > But when I was looking I found a case where BufferLockMode could be used > in the gin code (ginStepRight() and the brin (brinGetTupleForHeapBlock) > code but I am not sure there are worth fixing. I think these could be worth improving, if only to make the function signatures more clear (there are different kinds of enums for different kinds of lock modes).
В списке pgsql-hackers по дате отправления
От: Bryan Green
Дата: