[Gdal-dev] PG-Driver supporting no views?
Frank Warmerdam
warmerdam at pobox.com
Fri Apr 23 11:14:51 EDT 2004
Carl Anderson wrote:
> "DECLARE mycursor CURSOR for "
> "SELECT relname FROM pg_class "
> "WHERE (relkind in ('r','v') AND relname !~ '^pg'" );
Carl,
Cool, thats pretty easy. I will commit this change.
> The current method scans and describes every table in the database. This
> can take a very long time to do. I have 2000+ tables and the
> initialization of the OGR Pg driver takes almost a minute. From a
> practical standing that precludes my using in user interfaces.
My approach to this has varied from RDBMS to RDBMS. For the ODBC driver,
it is possible to optionally include a list of tables that you would like
to be represented in the layer list in the datasource name. For the Oracle
link I only treat spatial tables (those in the equivelent to the GEOMETRY_COLUMNS
table) as layers. The issue of supporting tables according to schemas has
also been raised.
I hope to provide several options in the postgres/postgis driver in the
relatively near future - perhaps the next month or two.
An underlying problem though is the OGR model where opening a datasource
results in identifying all layers and collecting schema information
for them all. I should have set things up so that you could get the
list of layer names without the layer objects having to be fully populated
(as they are now). Perhaps I will rectify this in some fashion when I
restructure OGR drivers to merge more closely with GDAL drivers.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the Gdal-dev
mailing list