From: Pepe TD Vo <pepevo@yahoo.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: execute a procedure from another procudure?
Date: Thu, 8 Nov 2018 20:13:55 +0000 (UTC)
Message-ID: <298826954.1145763.1541708035923@mail.yahoo.com> (raw)
In-Reply-To: <1a281089-1cb6-7e69-645a-050505a45a88@2ndquadrant.com>
References: <720744224.300433.1541599937254.ref@mail.yahoo.com>
<720744224.300433.1541599937254@mail.yahoo.com>
<1a281089-1cb6-7e69-645a-050505a45a88@2ndquadrant.com>
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.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@2ndquadrant.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: pepevo@yahoo.com, peter.eisentraut@2ndquadrant.com
Subject: Re: execute a procedure from another procudure?
In-Reply-To: <298826954.1145763.1541708035923@mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox