Re: Use LOCKMODE in parse_relation.c/.h - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Use LOCKMODE in parse_relation.c/.h
Date
Msg-id af3412e9-f9f7-4032-8c29-8a97e151534d@eisentraut.org
Whole thread Raw
In response to Re: Use LOCKMODE in parse_relation.c/.h  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
List pgsql-hackers
On 19.02.26 10:03, Ashutosh Bapat wrote:
> On Wed, Feb 18, 2026 at 3:20 PM Peter Eisentraut <peter@eisentraut.org> 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.
> 
> lockdefs.h is much younger (4eda0a64705763854225a29703b606692af50e77)
> than the comment (b153c0920960a6059b67969469166fb29c0105d7) mentioned
> above. The commit changed some #include "lock.h" to use lockdefs.h. I
> guess it didn't notice that parse_relation.h can use it because it
> didn't include lock.h and didn't define LOCKMODE. The change looks
> good to me.

committed




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PSA: Planning to grease protocol connections during 19beta
Next
From: Peter Eisentraut
Date:
Subject: Re: Use LOCKMODE in parse_relation.c/.h