[postgis-users] ogr_fdw create data source connection error for directory containing XLSX files

karsten karsten at terragis.net
Tue Jul 14 14:01:04 PDT 2020


Hi All,
 
I am learning how to use the get feature of foreign data wrappers and
successfully connected to various ogr data sources using ogr_fdw on postgres
12 on an ubuntu 16.04 server.
 
I wanted to use this to import a whole lot of data from XLSX files and was
able to get one table connected as below perfectly all good to go ...
 
CREATE SERVER cmein_xlsx
  FOREIGN DATA WRAPPER ogr_fdw
  OPTIONS (
        datasource '/var/xy/mapdata/source/geodata/xy1.xlsx',
        format 'XLSX' );
 
IMPORT FOREIGN SCHEMA ogr_all
    LIMIT TO("Raw Data")
FROM SERVER cmein_xlsx INTO public
OPTIONS(launder_table_names 'false', launder_column_names 'true');
 
However I read that (at least with shape files) it is possible to
alternatively to connect to a directory (and such to all shape file inside)
by setting the data source to that path. So for my XLSX files I tried as
below:
 
CREATE SERVER all_cmein_xlsx
  FOREIGN DATA WRAPPER ogr_fdw
  OPTIONS (
        datasource ''/var/xy/mapdata/source/geodata,
        format 'XLSX',
        config_options 'CPL_DEBUG=ON' );  
 
The directory ''/var/xy/mapdata/source/geodata is readable by the postgres
user ...
But the query above gives me the following error :
 
ERROR: unable to connect to data source "/var/xy/mapdata/source/geodata" SQL
state: HV00N
 
Is it even possible to connect via ogr_fdw to a directory of multiple XLSX
files like that 
and if so what am I missing to make it work ?
 
Karsten 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200714/48a1960a/attachment.html>


More information about the postgis-users mailing list