I have written a plpgsql function which updates a table in my database. Now I would like to write the output of the function to a log file (text format). Can someone please help me in achieving this. How can I make my plpgsql function write the logs along with the updation job which it does.