最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

postgresql - Orafce Implicit Data Conversion - Stack Overflow

programmeradmin3浏览0评论

In my project, I originally used an Oracle database but later switched to PostgreSQL. To avoid rewriting SQL, I used the orafce extension to keep Oracle-specific functions working.

Now, I'm switching to native PostgreSQL functions to remove the orafce extension. However, I ran into a problem:

ERROR: operator does not exist: bigint = character varying

that comes from:

select 1 from my_table where my_table_id = '100';

which works in oracle but not pgs

my question is: does orafce ensure Implicit Data Conversion like oracle and once i removed it it won't work anymore

In my project, I originally used an Oracle database but later switched to PostgreSQL. To avoid rewriting SQL, I used the orafce extension to keep Oracle-specific functions working.

Now, I'm switching to native PostgreSQL functions to remove the orafce extension. However, I ran into a problem:

ERROR: operator does not exist: bigint = character varying

that comes from:

select 1 from my_table where my_table_id = '100';

which works in oracle but not pgs

my question is: does orafce ensure Implicit Data Conversion like oracle and once i removed it it won't work anymore

Share Improve this question asked Mar 20 at 10:38 khaled djellalkhaled djellal 1111 silver badge10 bronze badges 1
  • 1) What version of Postgres? 2) select 100::bigint = '100'; t and select 100::bigint = '100'::unknown; t. So in what client is the query being run? – Adrian Klaver Commented Mar 20 at 15:54
Add a comment  | 

1 Answer 1

Reset to default 5

I am a author Orafce, and yes, Orafce supports lot of implicit casts, that are unsupported by Postgres without Orafce (or requires explicit casting). Generally, Oracle type system is very different than PostgreSQL type system. The base is very different. At the end, the Oracle is much more type tolerant, and Postgres is type strict system. Generally Postgres type system is working pretty well, but requires more clean style. Oracle allows very dirty (almost ugly) style of coding.

发布评论

评论列表(0)

  1. 暂无评论