Oracle 到 Postgresql 查询转换

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5619806/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 23:18:46  来源:igfitidea点击:

Oracle to Postgresql Query Conversion

sqloraclepostgresql

提问by Pavunkumar

Actually I have some oracle query which is about oracle database default tables. That is working in the oracle. Now I want to execute those queries in my postgresql database. What is the correct way to do that....?

实际上我有一些关于 oracle 数据库默认表的 oracle 查询。那是在oracle中工作。现在我想在我的 postgresql 数据库中执行这些查询。这样做的正确方法是什么......?

For some of the queries I am able to convert from oracle to postgresql as follows.

对于某些查询,我可以按如下方式从 oracle 转换为 postgresql。

example 1: 

Oracle : Select * from dba_users  ; 
Equal Posgresql query is : select * from pg_users ; 

example 2: 
oracle : select * from dba_role ; 
Equal Postgrsql query is : select * from pg_roles

Like this I need to convert many queries which should work in postgres. Is there any tool to convert ...?

像这样,我需要转换许多应该在 postgres 中工作的查询。有什么工具可以转换...?

Thanks

谢谢

回答by Peter Eisentraut

There isn't, to my knowledge, a one-stop tool that will fix all your problems, but the information at http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#Oracleshould help you to plough through it manually.

据我所知,没有一个一站式工具可以解决您的所有问题,但是http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#Oracle 上的信息应该可以帮助您手动解决它。