I worked around with the transaction and it gives me no error and I assumed it works.
create or replace FUNCTION "CIDR_STAGING"."PR_WRITE_ERROR_LOG" ( v_os_user IN varchar(4000), v_host IN
varchar(4000), v_module IN varchar(4000), v_errorcode IN int, v_errormsg IN varchar(4000) )
RETURNS VOID
as $$
BEGIN
START TRANSACTION;
insert into cidrmgmt.errorlog(
tstamp, os_user,host,module,errorcode,errormsg)
values
(current_timestamp, v_os_user, v_host, v_module, v_ErrorCode, v_ErrorMsg );
/* commit; */
end;
$$ LANGUAGE plpgsql;
CREATE FUNCTION
Query returned successfully in 107 msec.
thank you all.
Bach-Nga
No one in this world is pure and perfect. If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.
No one in this world is pure and perfect. If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.
To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.
*** Genuinely rich *** Faithful talent *** Sharing success
On Thursday, November 8, 2018 4:00 AM, Peter Eisentraut <peter.eisentraut@xxxxxxxxxxxxxxx> wrote:
On 07/11/2018 15:12, Pepe TD Vo wrote:
> and I converted it to Postgres Pragma autonomous_transaction and I'm not
> sure its corrected but it didn't give any error.
PostgreSQL does not support autonomous transactions. Some people use
dblink as a workaround.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
> and I converted it to Postgres Pragma autonomous_transaction and I'm not
> sure its corrected but it didn't give any error.
PostgreSQL does not support autonomous transactions. Some people use
dblink as a workaround.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services