pgsql-ogr-fdw
pgsql-ogr-fdw copied to clipboard
Can't import a file with a field called fid
I assume this is the case for all files, but I tried reimporting an excel spreadsheet I had exported from an imported table and was greeted with this message:
IMPORT FOREIGN SCHEMA ogr_all FROM SERVER svr_dues INTO staging;
column "fid" specified more than once
Thinking maybe if there is an existing we should rename it rather than just erroring out.
Ran into this again when trying to load up this shapefile - https://opendata.arcgis.com/datasets/956e52eb7abb4787abd7386e8efd600b_0.zip?outSR=%7B%22latestWkid%22%3A3857%2C%22wkid%22%3A102100%7D
Linked from - https://bmore-open-data-baltimore.hub.arcgis.com/datasets/police-districts-5
I wonder if they use GDAL to export to shapefile :)
This seems to break the regression tests for 1.1.1 with PG14:
10:58:38 **** regression.diffs ****
10:58:38 diff -U3 /tmp/autopkgtest.hS6MBA/tree/expected/pgsql.out /tmp/autopkgtest.hS6MBA/tree/results/pgsql.out
10:58:38 --- /tmp/autopkgtest.hS6MBA/tree/expected/pgsql.out 2021-06-25 08:58:37.138682292 +0000
10:58:38 +++ /tmp/autopkgtest.hS6MBA/tree/results/pgsql.out 2021-06-25 08:58:38.086673109 +0000
10:58:38 @@ -179,6 +179,7 @@
10:58:38 DELETE FROM bytea_fdw
10:58:38 WHERE fid = 4;
10:58:38 DEBUG: OGR SQL: (fid = 4)
10:58:38 +ERROR: cannot find 'fid' column in table 'bytea_fdw'
10:58:38
10:58:38 SELECT a.fid, a.name, b.name
10:58:38 FROM bytea_local a
10:58:38 @@ -189,6 +190,7 @@
10:58:38 1 | Jim | Jim
10:58:38 2 | Marvin | Marvin
10:58:38 3 | |
10:58:38 -(3 rows)
10:58:38 + 4 | Maggie | Maggie
10:58:38 +(4 rows)
10:58:38