[GENERAL] Using ctid in delete statement - Mailing list pgsql-general

From pinker
Subject [GENERAL] Using ctid in delete statement
Date
Msg-id 1487172753193-5944434.post@n3.nabble.com
Whole thread Raw
Responses Re: [GENERAL] Using ctid in delete statement  (Vick Khera <vivek@khera.org>)
List 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.


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] Missing feature - how to differentiate insert/update inplpgsql function?
Next
From: Leonardo M. Ramé
Date:
Subject: [GENERAL] Foreign Data Wrapper for filesystem