I'm trying run a SELECT
query and then for each of the results I want to print something in the console. However, I get no results, and I have no idea why. If I run the SELECT
on its own I do get table names.
create or replace function test()
RETURNS void AS
$body$
DECLARE
elem text;
begin
FOR elem IN
SELECT table_name FROM information_schema.tables WHERE table_name ~ 'api_configuration_'
LOOP
raise notice 'Table name is: %', elem;
END LOOP;
end;
$body$
LANGUAGE plpgsql
I want to print each table_name
found by the query