]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Use LOCKMODE in parse_relation.c/.h
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 23 Feb 2026 20:17:06 +0000 (21:17 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 23 Feb 2026 20:25:55 +0000 (21:25 +0100)
commitaca61f7e5f8a8a96865d33d0a6f993bf346f47db
tree231a84f5a039e01a8dfd355b45d6e0c9678db09d
parent4966bd3ed95e0d02bf220c4bad2b292963827dd4
Use LOCKMODE in parse_relation.c/.h

There were 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.

Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/4bcd65fb-2497-484c-bb41-83cb435eb64d%40eisentraut.org
src/backend/parser/parse_relation.c
src/include/parser/parse_relation.h