I have the following function for handling exception.
create or replace function fun_test(a varchar) returns void as
$$
begin
insert into test values(a);
exception when others
then
raise info '%',SQLSTATE;
end;
$$
The above function gives me the output:
OUTPUT:
INFO: 42804
Note: I want to record the same output in the *.log file.
COPY, but it won't append to file, etc... please give us details - what exactly you wont, not just*.log