Write to a file from RAISE NOTICE in postgresql
问题 I have one sample function in postgresql and it raises a notice. Sample function - CREATE OR REPLACE FUNCTION raise_test() RETURNS TEXT AS $body$ DECLARE retStr TEXT; BEGIN SELECT current_timestamp into retStr; RAISE NOTICE '%', retStr ; RETURN retStr; END; $body$ LANGUAGE plpgsql; Is there any way to update above function so that the entire notice stored into a file? Like if I hit "call raise_test();" and in my specfic location I 'll have one out.txt with the entire notice printed. PS. I hv