<div dir="ltr">I'm afraid that success in XC-1.2.1 is just by chance.   XC (and XL) does not guarantee ctid as a key for operation.  There are two possible cases of this ctid issue:<div><br></div><div>1) replicated table: for the same raw, ctid may be different from node to node.</div><div>2) distributed table: because ctid is not distribution key, XL planner may not be able to locate the target datanode.</div><div><br></div><div>The first error's cause may be 2).</div><div><br></div><div>The second error's direct cause is planner's limitation but anyway you will encounter the same restriction.</div><div><br></div><div>If your query is just for maintenance purpose, you can perform the query directly at each datanode, using "execute direct" after "set xc_maintenance_mode to on".   Be sure that this operation is allowed only to database superuser and you have to be responsible to any of the side effect.</div><div><br></div><div>Good luck;</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">---<div>Koichi Suzuki</div><div><a href="https://www.linkedin.com/in/koichidbms" target="_blank">https://www.linkedin.com/in/koichidbms</a><br></div><div><br></div></div></div></div></div></div>
<br><div class="gmail_quote">2018-01-10 11:25 GMT+09:00 刘攀 <span dir="ltr"><<a href="mailto:leo.liu@postgresdata.com" target="_blank">leo.liu@postgresdata.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div><span style="font-family:Times New Roman;font-size:18px">Hi PostgreSQL-XL,<br></span></div><div><span style="font-family:Times New Roman;font-size:18px">We deployed postgres-xl-9.5r1.6, but we ran into a problem with the delete operation:</span></div><blockquote style="margin-right:0px" dir="ltr"><div><span style="font-family:Times New Roman;font-size:16px">psql (PGXL 9.5r1.6, based on PG 9.5.8 (Postgres-XL 9.5r1.6))<br>Type "help" for help.</span></div><div><span style="font-family:Times New Roman;font-size:16px">testdb=# create table trends(a text, itemid int);<br>CREATE TABLE<br>testdb=# delete from trends where ctid = any(array(select ctid from trends where itemid=26978 limit 5000));<br>ERROR:  could not perform TID scan on remote relation<br>testdb=# <br>testdb=# <br>testdb=# delete from trends where ctid in (select ctid from trends where itemid = 26978 limit 5000);<br>ERROR:  could not plan this distributed delete<br>DETAIL:  correlated or complex DELETE is currently not supported in Postgres-XL.<br>testdb=# </span></div></blockquote><div dir="ltr"><span style="font-family:Times New Roman;font-size:18px">However, the same operation, but in <font size="3">PostgresXC</font>-1.2.1 can perform successfully.</span></div><div dir="ltr"><span style="font-family:Times New Roman;font-size:18px"><span id="m_-3076886544700008575result_box" lang="en"><span>These two delete operations are sent by zabbix software, because there is a lot of historical data in the environment, so hope to bulk delete by ctid.</span></span></span></div><div dir="ltr"><span style="font-family:Times New Roman;font-size:18px"><span lang="en"><span class="m_-3076886544700008575short_text" id="m_-3076886544700008575result_box" lang="en"><span>So I would like to ask, is there any way to achieve a similar operation.</span></span></span></span></div></div><br>______________________________<wbr>_________________<br>
postgres-xl-bugs mailing list<br>
<a href="mailto:postgres-xl-bugs@lists.postgres-xl.org">postgres-xl-bugs@lists.<wbr>postgres-xl.org</a><br>
<a href="http://lists.postgres-xl.org/listinfo.cgi/postgres-xl-bugs-postgres-xl.org" rel="noreferrer" target="_blank">http://lists.postgres-xl.org/<wbr>listinfo.cgi/postgres-xl-bugs-<wbr>postgres-xl.org</a><br>
<br></blockquote></div><br></div>