pgsql-ogr-fdw
pgsql-ogr-fdw copied to clipboard
Microsoft SQL Azure foreign table does not allow updates
I am having the same issues as #171 and I am wondering if updating or deleting be any different for Microsoft SQL Azure 12? I am able to connect and read the tables just fine, but I am getting 'Foreign table does not allow updates' for updates and then "cannot find 'fid' column in table" for delete. I do have an integer primary key in the table and is read as the fid. I set the client to debug and do not see any errors
UPDATE dforce_mssql_fdw_test.fed_lands_test
SET "type"='National Wilderness Area'
WHERE fid=7223
bind
I am able to insert new rows without error.
I am using Postgres 14 Postgis 3.2.1 OGR_FDW 1.1 and GDAL 3.4.2
MSSQL Table CREATE TABLE [dbo].[fed_lands_test]( [ogr_fid] [int] IDENTITY(1,1) NOT NULL, [sp_geography] [geography] NULL, [name] nvarchar NULL, [type] nvarchar NULL, [type_abbrev] nvarchar NULL, [website] nvarchar NULL, [fed_land_id] [int] NULL, [layer_id] [int] NULL, [area_sq_mi] [float] NULL, CONSTRAINT [PK_fed_lands_test] PRIMARY KEY CLUSTERED ( [ogr_fid] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) )
Postgres Foreign table CREATE FOREIGN TABLE dforce_mssql_fdw.fed_lands_test ( fid int8 NULL, sp_geography public.geometry(geometry, 4326) NULL, "name" varchar(250) NULL, "type" varchar(50) NULL, type_abbrev varchar(10) NULL, website varchar(250) NULL, fed_land_id int4 NULL, layer_id int4 NULL, area_sq_mi float8 NULL ) SERVER dforce_mssql_test OPTIONS (layer 'fed_lands_test', updateable 'true');
Possible that the latest fixes also fix your problem, as they were a result of Pg14 changes to update/delete support.