Using column privilege with geometry_columns and other metadata views

Regina Obe lr at pcorp.us
Wed Jul 15 14:05:36 PDT 2026


Arthur,

 

This change looks good to me.  Not sure why we didn’t use that in the first place.

 

The only thing I would change is to schema qualify those functions too with pg_catalog

I’m not sure how we missed doing that 

 

From: Arthur Bazin <ab-postgis-devel at bazmap.com> 
Sent: Wednesday, July 15, 2026 3:10 PM
To: postgis-devel at lists.osgeo.org
Subject: Using column privilege with geometry_columns and other metadata views

 

Hello,

 

I've seen that geometry_columns, geography_columns, raster_columns and raster_overviews only display layers for which the role can at least SELECT on the table.

But sometimes privileges are specific and only a subset of columns are defined as ''SELECTable''.

These views doesn't reference the geom column if its privileges are column defined like this :

GRANT SELECT(geom) ON schema.my_table TO my_user;

 

We need to use has_column_privilege() instead of has_table_privilege() in the where clause of these views.

The first function succeeds either if the privilege is held for the whole table, or if there is a column-level grant of the privilege for the column.

 

I've made a fork of the PostGIS project to test this update and it works great.

I've created a branch and commited the modifications to make a PR : https://gitea.osgeo.org/arthurbazin/postgis/commit/d75464c991d25dc1f602a9e641ce40a8bfaaaea0

 

Before submitting it, I would like to have your opinion on this improvement.

 

Note that I didn't create any ticket on track to avoid the auto resolution by the new AI bot (if my informations are good) and start my first PR on this project (easy one but we need to start somewhere)

 

Best regards !

 

/// Arthur Bazin ___

⟁ France

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20260715/5e326f81/attachment.htm>


More information about the postgis-devel mailing list