Using ctid in delete statement

From: pinker <pinker(at)onet(dot)eu>
To: pgsql-general(at)postgresql(dot)org
Subject: Using ctid in delete statement
Date: 2017-02-15 15:32:33
Message-ID: 1487172753193-5944434.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
is it safe to use ctid in following query? :

DELETE FROM table_name WHERE ctid = any ( array ( select tn.ctid from
table_name tn JOIN items i on tn.itemid=i.itemid WHERE tn.clock < extract (
epoch FROM now() - i.history * interval '10 day')::int + 6 limit 100));

Could I be sure that ctid will not change during the execution or will not
do any harm to other transactions?

regards

--
View this message in context: http://postgresql.nabble.com/Using-ctid-in-delete-statement-tp5944434.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leonardo M. Ramé 2017-02-15 15:39:05 Foreign Data Wrapper for filesystem
Previous Message Adrian Klaver 2017-02-15 15:25:48 Re: Missing feature - how to differentiate insert/update in plpgsql function?