cancel
Showing results for 
Search instead for 
Did you mean: 

dblink bug?

Highlighted
Yu
Level 3 Traveller

dblink bug?

Hi guys,

A serious problem occurred during database operation.

It looks like a dblink bug.

Please look at the script I tested.


-- database A

create table partition_test
(
a int primary key,
b text,
c date
)
partition by range(c)
(
partition pt_201805 values less than ('2018-06-01'),
partition pt_201806 values less than ('2018-07-01'),
partition pt_201807 values less than ('2018-08-01'),
partition pt_max values less than (maxvalue)
);

insert into partition_test values(1, 'test1', '2018-05-06'::date);
insert into partition_test values(2, 'test2', '2018-06-06'::date);
insert into partition_test values(3, 'test3', '2018-07-06'::date);

 

select ctid,* from partition_test;
-----
(0,1) 1 test1 2018-05-06 00:00:00
(0,1) 2 test2 2018-06-06 00:00:00
(0,1) 3 test3 2018-07-06 00:00:00


-- database B

select * from all_db_links where db_link = 'DGSHF_DBA';
-----
PUBLIC DGSHF_DBA EDB EDBFRONT host=localhost port=5445 dbname=dgshf

 

select * from dba_work.partition_test@dgshf_dba;
-----
1 test1 2018-05-06 00:00:00
2 test2 2018-06-06 00:00:00
3 test3 2018-07-06 00:00:00

 

-- I made an update statement to database A.
update dba_work.partition_test@dgshf_dba
set b = 'good'
where a = 1

 

-- wow! All rows with the same ctid have been updated.
select * from dba_work.partition_test@dgshf_dba;
-----
1|good|2018-05-06 00:00:00
2|good|2018-06-06 00:00:00
3|good|2018-07-06 00:00:00

 

Wait for your opinion.

Thanks.

2 REPLIES
Yu
Level 3 Traveller

Re: dblink bug?

my os version

-----

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)

 

my epas version

-----

SQL> select version();
+-------------------------------------------------------------------------------------------------------------+
| version |
+-------------------------------------------------------------------------------------------------------------+
| EnterpriseDB 10.3.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18), 64-bit |
+-------------------------------------------------------------------------------------------------------------+
(1 row)

 

thanks

Moderator

Re: dblink bug?

Hi,

The reported issue is already known as a bug in the dblink and postgres_fdw. The reference redmine case# is 43469 and development team is working on the same.

You can track the similar issue reported for the postgres_fdw on below link,


https://www.postgresql.org/message-id/flat/CAFjFpRfcgwsHRmpvoOK-GUQi-n8MgAS%2BOxcQo%3DaBDn1COywmcg%4...