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 
_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to