Using column privilege with geometry_columns and other metadata views

Arthur Bazin ab-postgis-devel at bazmap.com
Wed Jul 15 14:14:35 PDT 2026


Great, I will change that and made a pull-request.

Best regards !

/// ARTHUR BAZIN ___

Le 2026-07-15T23:05:45.000+02:00, Regina Obe <lr at pcorp.us> a écrit :

> 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/bfe845d6/attachment-0001.htm>


More information about the postgis-devel mailing list