Reputation: 8919
When stepping through a function in the pgAdmin debugger, how to examine the contents of temporary tables, if that is possible?
Upvotes: 2
Views: 602
Reputation: 26464
Probably the best thing to do would be to add conditional logic based on variables you could set in the debugger. Then you could set the variables to useful states and run that way. For example:
CREATE OR REPLACE FUNCTION test_function() RETURNS BOOL LANGUAGE PLPGSQL AS
$$
DECLARE t_debug int;
t_record RECORD;
BEGIN;
IF t_debug > 1 THEN
FOR t_record IN SELECT * FROM my_temp_table LOOP
RAISE NOTICE 'Row in my_temp_table: %', t_record::text;
END LOOP;
END IF;
RETURN TRUE;
$$;
Upvotes: 2