从oracle数据库服务器向postgresql插入新记录时遇到问题。在postgresql中插入新记录后,我丢失了时间戳字段的精度,所有指向微秒的数字都已丢失。这是我的示例代码:
declare
v_date timestamp(6):=to_timestamp('2013-06-04 12:03:01.123456','YYYY-MM-DD HH24:MI:SS.FF6');
begin
dbms_output.put_line (v_date);
insert into "public"."DAS_ITEM"@PG_LINK
("DOCKID","CANDY_ITM_NBR","MODIFIED_ON") VALUES (1,3, v_date);
commit;
end;
运行pl / sql之后,我想直接从postgres查询数据
select "DOCKID","CANDY_ITM_NBR", to_char("MODIFIED_ON", 'YYYY-MM-DD HH24:MI:SS.US') from "DAS_ITEM";
以下是结果:
DOCKID | CANDY_ITM_NBR | MODIFIED_ON
-----------+---------------+---------------------------
1 | 3 | 2013-06-04 12:03:01.000000
目前, MODIFIED_ON 字段的值为' 2013-06-04 12:03:01.000000',我预计 MODIFIED_ON 的值是 2013-06-04 12:03:01.123456
请帮助我,我有36个小时的麻烦。