Opened 3 years ago

Last modified 20 months ago

#2821 new defect

[raster] Raster import fails if "raster_columns" is not readable by the user

Reported by: strk Owned by: dustymugs
Priority: high Milestone: PostGIS Future
Component: raster Version: 2.1.x
Keywords: Cc:

Description

Raster import fails rolling back the whole transaction if the "raster_columns" view is not readable by the user performing the import. Here's the extract:

NOTICE:  Returned error message: permission denied for relation raster_columns (42501)
CONTEXT:  PL/pgSQL function _add_overview_constraint(name,name,name,name,name,name,integer) line 24 at RETURN
PL/pgSQL function addoverviewconstraints(name,name,name,name,name,name,integer) line 61 at assignment
ERROR:  Unable to add the overview constraint.  Is the schema name, table name or column name incorrect?

Dunno why it select privileges should be granted for an import. If they are really needed the error message should contain the actual problem (currently only shown by the NOTICE)

Change History (13)

comment:1 Changed 3 years ago by strk

It is the AddRasterConstraints? query that fails, not the import itself.

comment:2 Changed 3 years ago by dustymugs

Owner: changed from pramsey to dustymugs

The overview constraint uses raster_columns to check for its relationship. I suppose the check could bypass raster_columns and go directly to pg_catalog.

comment:3 Changed 3 years ago by strk

Uhm, but as I'm seeing this at import time, the importer should know already what the relationship is as it creates it. Can we just not lookup anything in that case ?

comment:4 Changed 3 years ago by dustymugs

raster2pgsql (I assume the "importer") doesn't know that you're piping directly to psql.

comment:5 Changed 3 years ago by robe

strk -- which version of PostGIS are you using? Can you retest with the latest.

I'm really confused why this is even an issue and am tempeted to close as invalid. We already have raster_columns as publically readable. See our script at bottom of rtpostgis.sql.in

GRANT SELECT ON TABLE raster_columns TO public;
GRANT SELECT ON TABLE raster_overviews TO public;

and in my db it is publically readable.

The reason we made it publically readable (same reason we have geography_columns and geometry_columns) readable is because all the views already check if users have rights to said tables. So if they don't they wouldn't show up anyway in there query.

Presumably anyone creating a table via import would have rights to see the table and its constraints. You definitely should not be getting a permission denied and if you are witht eh latest 2.1.3, something else is wrong.

comment:6 Changed 3 years ago by strk

The reason why the view is not readable is out of scope here. It could be an upgrade issue, but would need a separate ticket.

This ticket is to get a better error message, or a functional importer, when the view is not readable.

comment:7 Changed 3 years ago by robe

I'm more interested in the issue that caused this (upgrade issue) than getting a more functional message for something that should never happen.

comment:8 Changed 3 years ago by robe

added new ticket for the main issue in #2905

comment:9 Changed 3 years ago by robe

Component: postgisraster

comment:10 Changed 3 years ago by robe

Milestone: PostGIS 2.1.4PostGIS 2.2.0

I think this needs more thought. Don't feel comfortable making any changes in 2.1.4 and like I said I think it might be only an upgrade issue if it is at all.

comment:11 Changed 2 years ago by dustymugs

Summary: Raster import fails if "raster_columns" is not readable by the user[raster] Raster import fails if "raster_columns" is not readable by the user

comment:12 Changed 2 years ago by dustymugs

Priority: mediumhigh

comment:13 Changed 20 months ago by robe

Milestone: PostGIS 2.2.0PostGIS Future

Again is this really an issue. I'm temepted to just close this out as an invalid or won't fix.

Note: See TracTickets for help on using tickets.