当前位置:网站首页>oracle带xy字段值的关系表同步到pg数据库转为几何字段
oracle带xy字段值的关系表同步到pg数据库转为几何字段
2022-06-10 23:41:00 【L.傲骨雄风】
1.下载oracle_fdw
https://github.com/laurenz/oracle_fdw/releases
2.将文件移动到pg安装路径下
下载完成将zip包解压,把【lib】文件夹的oracle_fdw.dll和【share/extension】目录下的三个文件分别复制到PostgreSQL安装目录下的【lib】文件夹和【share/extension】目录里去。
-- 创建oracle_fdw
create extension oracle_fdw;
-- 语句能查询到oracle_fdw extension,
select * from pg_available_extensions;
3.通过oracle_fdw访问oracle
--创建访问oracle的连接
create server oracle foreign data wrapper oracle_fdw options(dbserver '127.0.0.1:1521/orcl');
--授予postgres用户访问权限
grant usage on foreign server oracle to postgres;
--创建到oracle的映射
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名称必须大写
--在pg中访问oracle的表
select st_geomfromtext('POINT('||X||' '||Y||')',4550) from point
【另外说明:oracle数据增删pg数据会跟着改变,保持实时同步】
边栏推荐
- How about the CSC account of qiniu business school? Is it safe?
- Blocking queue - delayedworkqueue source code analysis
- B 树的简单认识
- 五大类型负载均衡的原理场景详解
- SQL审核 | “云上”用户可以一键使用 SQLE 审核服务啦
- Adapter mode
- How to ensure the sequence of messages, that messages are not lost or consumed repeatedly
- 12324243242
- Multipass Chinese document - instructions for use (contents page)
- Word删除页眉横线的方法
猜你喜欢

五大类型负载均衡的原理场景详解

lucene思维导图,让搜索引擎不再难懂

Blog recommendation | building IOT applications -- Introduction to flip technology stack

海贼oj#146.字符串

Wechat applet to realize OCR scanning recognition

With a market value of 21.5 billion yuan, will the post-80s generation in Sichuan make TV history?

Unable to return to the default page after page Jump

如何在office2016(word2016)中安装mathtype6.9及相关问题解决方案

跳转页面后回不去默认页面

Adapter mode
随机推荐
【无标题】6666666
STM32 cannot download again after downloading the code
JVM garbage collection mechanism and common garbage collectors
With a market value of 21.5 billion yuan, will the post-80s generation in Sichuan make TV history?
富文本活动测试1
Go language channel understanding and use
Baidu PaddlePaddle paddlepaddle latest series AI course playback address
Yii2 activerecord uses the ID associated with the table to automatically remove duplicates
图的最短路径问题 详细分解版
AQS explanation of concurrent programming
对象作为点(Objects as Points) 个人总结
[network planning] 1.3 packet switching and circuit switching in the network core
非重叠矩形中的随机点
array_ column() expects parameter 1 to be array, array given
Block queue - delayedworkqueue Source Analysis
Complete collection of MySQL exercises (with answers) - you will know everything after practice
[network planning] 3.2 transport layer - UDP: connectionless service
海贼oj#146.字符串
systemd 下开机启动的优化,删除无用的systemd服务
LeetCode 8. String to integer (ATOI) (medium, string)