Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#3291 closed defect (fixed)

WKT Raster driver: Error checking permissions when trying to open a PG dataset

Reported by: jorgearevalo Owned by: jorgearevalo
Priority: high Milestone: 1.7.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: postgis_raster
Cc:

Description

If you try to access a PG table and its owner is different from the schema owner, the driver can't find the table. The query that performs this is:

SELECT attname FROM pg_class, pg_attribute, pg_type, pg_namespace WHERE

pg_class.oid = pg_attribute.attrelid and pg_class.relname = '<TABLE_NAME>' and pg_class.relowner = pg_namespace.nspowner and pg_namespace.nspname = '<SCHEMA_NAME>' and pg_attribute.atttypid = pg_type.oid and pg_type.typname = 'raster'

Change History (3)

comment:1 by jorgearevalo, 14 years ago

Component: defaultGDAL_Raster
Resolution: fixed
Status: newclosed

Fixed in trunk r18325. Finally, the query was changed by this other one:

SELECT

attname

FROM

pg_class, pg_attribute, pg_type, pg_namespace

WHERE

pg_namespace.nspname = '<SCHEMA>' and pg_namespace.oid = pg_class.relnamespace and pg_class.relname = '<NAME>' and pg_class.oid = pg_attribute.attrelid and pg_attribute.atttypid = pg_type.oid and pg_type.typname = 'raster'

I think this was not necessary: pg_class.relowner = pg_namespace.nspowner

(schema owner doesn't need to be equal to table owner)

in reply to:  1 comment:2 by jorgearevalo, 14 years ago

Replying to jorgearevalo:

Fixed in trunk r18325. Finally, the query was changed by this other one:

SELECT

attname

FROM

pg_class, pg_attribute, pg_type, pg_namespace

WHERE

pg_namespace.nspname = '<SCHEMA>' and pg_namespace.oid = pg_class.relnamespace and pg_class.relname = '<NAME>' and pg_class.oid = pg_attribute.attrelid and pg_attribute.atttypid = pg_type.oid and pg_type.typname = 'raster'

I think this was not necessary: pg_class.relowner = pg_namespace.nspowner

(schema owner doesn't need to be equal to table owner)

I forgot it. Thanks to Pierre Racine, who made me to find this problem.

comment:3 by pracine, 12 years ago

Keywords: postgis_raster added; wkt removed
Note: See TracTickets for help on using tickets.