Now I want to delete all entries from ims_point, where the timestamp is older than one hour. The currently being referenced ids of the table ims_object_header should be excluded from this deletion.
delete from public.ims_point ip where ip.timestamp < current_timestamp - interval '1 hour' and not exists ( select 'reference exists' from public.ims_object_header ioh where ioh.last_point_id = ip.point_id ) ;
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.