暂无图片
postgres oracle_fdw2.4版本IMPORT FOREIGN SCHEMA的bug???
我来答
分享
jieguo
2022-03-09
postgres oracle_fdw2.4版本IMPORT FOREIGN SCHEMA的bug???

pg12.4版本,使用IMPORT FOREIGN SCHEMA orauser LIMIT TO (test) FROM SERVER oradb39 INTO public;报错如下
ERROR: remote schema “orauser” does not exist
HINT: Enclose the schema name in double quotes to prevent case folding.
用户和表都是存在的,但是就是报错如上。
如果用创建外部表的方式操作是正常的:

# create FOREIGN table TEST 
(
  fldname      VARCHAR,
  flddisp_name VARCHAR
) SERVER oradb39 OPTIONS (SCHEMA 'ORAUSER', TABLE 'TEST');
CREATE FOREIGN TABLE
# select count(*) from test;
 count 
-------
   154
(1 row)

我来答
添加附件
收藏
分享
问题补充
3条回答
默认
最新
彭冲

用下面的命令测试是没问题的

IMPORT FOREIGN SCHEMA "SCOTT"
FROM SERVER server_ora 
INTO public
OPTIONS (case 'lower', readonly 'true',max_long '32767',sample_percent '100', prefetch  '0');

image.png

暂无图片 评论
暂无图片 有用 0
暂无图片
jieguo
题主
2022-03-10
找到原因了,是SCHEMA "SCOTT"这块,必须双引号+大写字母
彭冲

IMPORT FOREIGN SCHEMA试试把orauser大写,或者用双引号嵌套试试。

暂无图片 评论
暂无图片 有用 0
jieguo
题主
2022-03-10
都是试过,不行
彭冲
答主
2022-03-10
你确认试过么
彭冲

官方文档有下面这段描述:

These are the supported options for IMPORT FOREIGN SCHEMA:

case: controls case folding for table and column names during import

The possible values are:

keep: leave the names as they are in Oracle, usually in upper case.
lower: translate all table and column names to lower case.
smart: only translate names that are all upper case in Oracle (this is the default).

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏