CREATE OR REPLACE FUNCTION drop_now() RETURNS void AS $BODY$ DECLARE row record; BEGIN RAISE INFO 'in'; FOR row IN select relname from pg_stat_user_tables WHERE schemaname='public' AND relname LIKE '%test%' LOOP IF EXISTS(SELECT row.relname.tm FROM row.relname WHERE row.relname.tm < current_timestamp - INTERVAL '90 minutes' LIMIT 1) THEN
Could you tell me how to use the variables in SELECT that are inside IF EXISTS ? Currently row.relname.tm and row.relname are row.relname processed literally, which I don't want.
Tom Nov 25 '13 at 12:42 2013-11-25 12:42
source share