当前位置:网站首页>Oracle relational tables with XY field values are synchronized to PG database and converted to geometric fields

Oracle relational tables with XY field values are synchronized to PG database and converted to geometric fields

2022-06-11 01:12:00 50. Proud and heroic

1. download oracle_fdw
https://github.com/laurenz/oracle_fdw/releases
2. Move files to pg Under installation path
The download will complete zip Package decompression , hold 【lib】 The folder oracle_fdw.dll and 【share/extension】 The three files in the directory are copied to PostgreSQL Install under directory 【lib】 The folder and 【share/extension】 In the catalog .

-- establish oracle_fdw
create extension oracle_fdw;
-- Statement can query oracle_fdw extension,
 select * from pg_available_extensions;
3. adopt oracle_fdw visit oracle
-- Create access oracle The connection of
create server oracle foreign data wrapper oracle_fdw options(dbserver '127.0.0.1:1521/orcl');
-- grant postgres User access rights
grant usage on foreign server oracle to postgres;
-- Create to oracle Mapping
create user mapping for postgres server oracle options(user 'gis',password 'gis');
create foreign table point(
tp_guid  uuid,
x     numeric,
y     numeric,
lng     numeric,
lat     numeric,
remarks varchar(150)
) server oracle options(schema 'GIS',table 'POINT');  //scheme table The name must be capitalized
-- stay pg Medium visit oracle Table of
select st_geomfromtext('POINT('||X||' '||Y||')',4550) from point

In addition :oracle Data addition and deletion pg The data will change , Keep it in real time

原网站

版权声明
本文为[50. Proud and heroic]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206102341399567.html