Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iURGc-0002L2-Dz for pgsql-admin@arkaria.postgresql.org; Tue, 12 Nov 2019 08:11:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iURGZ-0003m9-R4 for pgsql-admin@arkaria.postgresql.org; Tue, 12 Nov 2019 08:11:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iURGZ-0003lf-56 for pgsql-admin@lists.postgresql.org; Tue, 12 Nov 2019 08:11:11 +0000 Received: from mail-dasl.optinet.hr ([85.114.35.7]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1iURGV-00025e-7a for pgsql-admin@lists.postgresql.org; Tue, 12 Nov 2019 08:11:09 +0000 Received: from [192.168.0.20] (89-201-194-93.dsl.optinet.hr [89.201.194.93]) by mail-dasl.optinet.hr (OptimaMail-adsl1) with SMTP for pgsql-admin@lists.postgresql.org; Tue, 12 Nov 2019 09:11:01 +0100 (CET) Subject: Re: commit & rollback To: pgsql-admin@lists.postgresql.org References: <1282101845.2072668.1572443106316.ref@mail.yahoo.com> <1282101845.2072668.1572443106316@mail.yahoo.com> From: Arni Openpgp: preference=signencrypt Autocrypt: addr=Arni.Kromic@Bios-ICT.hr; prefer-encrypt=mutual; keydata= xsFNBFq+khoBEACdC7vnOWflosSNLuIZrzGNh4ADaQbLSGWQVBal0etZB+HZhLK86dKLoMPd ZQdKg3L8hTSj8mnRawDupUoi/CQeWpnhVH9QWXPtCpf7WD9u4VDK/g9i1WTOIKw+tcN/KGzC CxIXyvZgwNGy5oxTmSxwbHS9De4p9/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CQlmAYAACgkQffOedavO0IIjfQ/7Bh5bViTTu6V2MtUkuGX3r5sbWv25PJOJ u2fMLhB/2FfbseP6HmuHcXx7hCPVMYKqClGtKlJJzyyTsQNw7yyfZzR1YFl1gmn6i6kWOQzj RJgEJBF1BybdGvYRW0AnrlsMKJwo9yRi0y/dd6Tqwz70/LrpdjufM5OKKfTBRS97zeY7di4Y G0iZEcCFGS+y0DQn6lT6DsJIQWattI4yKnWss7rJhLYNLa5mZIsyTceT88DicDwZLK7T/bJs LZ5iqqDjb3XQeXxpI654Z3QAjrtQ01Q+oiEZTvyYVbTaIi3UgSnNT1zp58c+lPxxjZgOhZAz 7HCCgtsQlBQW05O1t2D96EekIkKQFoFIB+wgc5EazDpRSZHKe9e+76yqWuNafRGjevNy60UI TTx05+po7kNWxd24C/MUj+otdyALGr1qmPbtbePs4LcOuQr/vhVFG9Kf4swxzx1C+Yc/icRz bblJQJTfGnHI7iQQNxMN7l0HFtlhtnyCk41cTBbM7eCDHxZNyK/Yhw+u74woiSElmhhkpIiW iXvy0/k/XoiKhGY4erYee5dDIY/DFuOv8C1g8snZ/XBEmp3u6tkZXmG5JKC0iJ87Hg623fvU SKjtNgnUGhTCURtzrIPjthErfOcIPaQdpa1h1076+2N6An7uqWnJBR6/ztqQlVP+IGemNP6y 6w0= Organization: BIOS ICT d.o.o. Split Message-ID: Date: Tue, 12 Nov 2019 09:11:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1282101845.2072668.1572443106316@mail.yahoo.com> Content-Type: multipart/alternative; boundary="------------79DC5DFFA97F19C7AEF4FFB2" Content-Language: hr-HR X-OM-Umi: 89.201.194.93:50610:793560 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------79DC5DFFA97F19C7AEF4FFB2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit You can't control transactions within a function. However you can do it within a procedure so the obvious solution would be to convert the main function to a procedure. You need PG 11 for that though, there were no stored procedures before it. Pozdrav, Arni On 30/10/2019 14.45, Pepe TD Vo wrote: > Hello experts, > > I have a main functions call the child functions.  If one of the child > function break, I want the main function stop and tell me what the > error.  From my test, if I break one from the main function and no > other functions execute. That's fine, but if I break the child, the > main function notice the error and still execute the rest of function, > which I want it stop and tell me what caused the error as same as the > one break from the main function.  How do I commit and rollback the > function. > > here is my main function script: > > CREATE OR REPLACE FUNCTION ecisdrdm.pr_merge_staging_tables( > OUT v_ret text) >     RETURNS text >     LANGUAGE 'plpgsql' > >     COST 100 >     VOLATILE  > AS $BODY$ >     > DECLARE > >    v_errorcode      text; >    v_errormsg       varchar(512); >    v_module         varchar(32) = 'pr_merge_staging_tables'; >    v_hostvarchar(32) = inet_server_addr(); > > begin > > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Starting MERGE Process' ); > begin > v_ret = '0'; > > if v_ret = '0' then > --- > --- Perform the merge on APPLICATION_CDIM > --- >       > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Started merging STG_APPLICATION_CDIM' ); > PERFORM ecisdrdm.pr_mig_stg_application_cdim(); > -- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM > FUNCTION > v_ret = '0'; > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Finished merging STG_APPLICATION_CDIM' ); > end if; > /* > exception >    when others then > GET STACKED DIAGNOSTICS v_ret = PG_EXCEPTION_CONTEXT; > RAISE INFO 'Error Name:%',SQLERRM; >         RAISE INFO 'Error State:%', SQLSTATE; >         RAISE INFO 'Error Context:%', v_errorcode; > */ > end; > > ---- > ---  2. STG_BNFT_CURR_FACT > ---- >     > if v_ret = '0' then > > --- > --- Perform the merge on BNFT_CURR_FACT > --- > > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Started merging STG_BNFT_CURR_FACT' ); > PERFORM ecisdrdm.pr_mig_stg_bnft_curr_fact(); > -- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM > FUNCTION > v_ret = '0'; > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Finished merging STG_BNFT_CURR_FACT' ); > end if; > > ---- > --  3. STG_BNFT_FACT > ---- >     > if v_ret = '0' then > --- > --- Perform the merge on BNFT_FACT > --- >       > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Started merging STG_BNFT_FACT' ); > PERFORM ecisdrdm.pr_mig_stg_bnft_fact(); > -- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM > FUNCTION > v_ret = '0'; > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Finished merging STG_BNFT_FACT' ); > end if; > > ---- > --  4. STG_BNFT_HIST_ACTN_LDIM > ---- >     > if v_ret = '0' then > --- > --- Perform the merge on BNFT_HIST_ACTN_LDIM > --- >       > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Started merging STG_BNFT_HIST_ACTN_LDIM ' ); > PERFORM ecisdrdm.pr_mig_stg_bnft_hist_actn_ldim (); > -- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM > FUNCTION > v_ret = '0'; > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Finished merging STG_BNFT_HIST_ACTN_LDIM ' ); >    end if; > > ---- > --  5. STG_CNTRY_ST_CDIM > ---- >     > if v_ret = '0' then > --- > --- Perform the merge on CNTRY_ST_CDIM > --- >       > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0','Started merging STG_CNTRY_ST_CDIM ' ); > PERFORM ecisdrdm.pr_mig_stg_cntry_st_cdim(); > -- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM > FUNCTION > v_ret = '0'; > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Finished merging STG_CNTRY_ST_CDIM '); > end if; > > ---- > --  6. STG_FRM_CDIM > ---- >     > if v_ret = '0' then > --- > --- Perform the merge on FRM_CDIM > --- >       > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Started merging STG_FRM_CDIM ' ); > PERFORM ecisdrdm.pr_mig_stg_frm_cdim(); > -- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM > FUNCTION > v_ret = '0'; > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Finished merging STG_FRM_CDIM ' ); > end if; > > --- > --- This does the final commit or rollback for the entire merge process. > --- > > if v_ret = '0' then > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Finished MERGE PROCESS - COMMIT WORK' ); > /*commit work; */ > COMMIT; > else > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > '0', 'Finished MERGE PROCESS - ROLLBACK WORK ' ); > /*rollback work; */ > ROLLBACK; > > RAISE NOTICE 'PROGRAM_ERROR'; > end if; > > ---- > --- Exception error handler > ---- > > exception >    when others then >         v_errorcode := SQLSTATE; >         v_errormsg  := SQLERRM; > > PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, > v_errorcode, v_errormsg); > > END; > $BODY$ > SECURITY DEFINER; > > > if work fine without "rollback;" and when I put "rollback;" in, I get > "invalid transaction termination without tell me which child > function's error.  Now, I put it back the way it is w/o commit and > rollback.  All I get is "Finished MERGE PROCESS - ROLL BACK"....  > the weird thing is every single change in the main function, all still > stop working. > >  I can't seem to find  anything else a good thing to do with commit > and rollback, would you please tell me what cause the problem.  Now > all stop only the last statement "merge process - roll back" stated. > > thank you. > > ** > *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 > As I can't seem to find the script, anything else a good thing to do > after doing pg_upgrade to prime the DB? --------------79DC5DFFA97F19C7AEF4FFB2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit You can't control transactions within a function. However you can do it within a procedure so the obvious solution would be to convert the main function to a procedure. You need PG 11 for that though, there were no stored procedures before it.
Pozdrav,
Arni
On 30/10/2019 14.45, Pepe TD Vo wrote:
Hello experts,

I have a main functions call the child functions.  If one of the child function break, I want the main function stop and tell me what the error.  From my test, if I break one from the main function and no other functions execute. That's fine, but if I break the child, the main function notice the error and still execute the rest of function, which I want it stop and tell me what caused the error as same as the one break from the main function.  How do I commit and rollback the function.

here is my main function script:

CREATE OR REPLACE FUNCTION ecisdrdm.pr_merge_staging_tables(
OUT v_ret text)
    RETURNS text
    LANGUAGE 'plpgsql'

    COST 100
    VOLATILE 
AS $BODY$
   
DECLARE

   v_errorcode      text;
   v_errormsg       varchar(512);
   v_module         varchar(32) = 'pr_merge_staging_tables';
   v_host varchar(32) = inet_server_addr();

begin

PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Starting MERGE Process' );
begin
v_ret = '0';

if v_ret = '0' then
---
--- Perform the merge on APPLICATION_CDIM
---
     
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Started merging STG_APPLICATION_CDIM' );
PERFORM ecisdrdm.pr_mig_stg_application_cdim();
-- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM FUNCTION
v_ret = '0';
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Finished merging STG_APPLICATION_CDIM' );
end if;
/*
exception
    when others then
GET STACKED DIAGNOSTICS v_ret = PG_EXCEPTION_CONTEXT;
RAISE INFO 'Error Name:%',SQLERRM;
        RAISE INFO 'Error State:%', SQLSTATE;
        RAISE INFO 'Error Context:%', v_errorcode;
*/
end;

----
---  2. STG_BNFT_CURR_FACT
----
   
if v_ret = '0' then

---
--- Perform the merge on BNFT_CURR_FACT
---

PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Started merging STG_BNFT_CURR_FACT' );
PERFORM ecisdrdm.pr_mig_stg_bnft_curr_fact();
-- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM FUNCTION
v_ret = '0';
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Finished merging STG_BNFT_CURR_FACT' );
end if;

----
--  3. STG_BNFT_FACT
----
   
if v_ret = '0' then
---
--- Perform the merge on BNFT_FACT
---
     
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Started merging STG_BNFT_FACT' );
PERFORM ecisdrdm.pr_mig_stg_bnft_fact();
-- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM FUNCTION
v_ret = '0';
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Finished merging STG_BNFT_FACT' );
end if;

----
--  4. STG_BNFT_HIST_ACTN_LDIM
----
   
if v_ret = '0' then
---
--- Perform the merge on BNFT_HIST_ACTN_LDIM
---
     
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Started merging STG_BNFT_HIST_ACTN_LDIM ' );
PERFORM ecisdrdm.pr_mig_stg_bnft_hist_actn_ldim ();
-- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM FUNCTION
v_ret = '0';
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Finished merging STG_BNFT_HIST_ACTN_LDIM ' );
    end if;

----
--  5. STG_CNTRY_ST_CDIM
----
   
if v_ret = '0' then
---
--- Perform the merge on CNTRY_ST_CDIM
---
     
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0','Started merging STG_CNTRY_ST_CDIM ' );
PERFORM ecisdrdm.pr_mig_stg_cntry_st_cdim();
-- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM FUNCTION
v_ret = '0';
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Finished merging STG_CNTRY_ST_CDIM ');
end if;

----
--  6. STG_FRM_CDIM
----
   
if v_ret = '0' then
---
--- Perform the merge on FRM_CDIM
---
     
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Started merging STG_FRM_CDIM ' );
PERFORM ecisdrdm.pr_mig_stg_frm_cdim();
-- TODO: INVESTIGATE HOW TO RECEIVE THE OUT PARAMETER RETRUNED FROM FUNCTION
v_ret = '0';
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Finished merging STG_FRM_CDIM ' );
end if;

---
--- This does the final commit or rollback for the entire merge process.
---

if v_ret = '0' then
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Finished MERGE PROCESS - COMMIT WORK' );
/* commit work; */
COMMIT;
else
PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, '0', 'Finished MERGE PROCESS - ROLLBACK WORK ' );
/* rollback work; */
ROLLBACK;

RAISE NOTICE 'PROGRAM_ERROR';
end if;

----
--- Exception error handler
----

exception
   when others then
        v_errorcode := SQLSTATE;
        v_errormsg  := SQLERRM;

PERFORM ecisdrdm.pr_write_error_log( CURRENT_USER, v_host, v_module, v_errorcode, v_errormsg);

END;
$BODY$
SECURITY DEFINER;


if work fine without "rollback;" and when I put "rollback;" in, I get "invalid transaction termination without tell me which child function's error.  Now, I put it back the way it is w/o commit and rollback.  All I get is "Finished MERGE PROCESS - ROLL BACK".... 
the weird thing is every single change in the main function, all still stop working.

 I can't seem to find  anything else a good thing to do with commit and rollback, would you please tell me what cause the problem.  Now all stop only the last statement "merge process - roll back" stated.

thank you.

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
As I can't seem to find the script, anything else a good thing to do after doing pg_upgrade to prime the DB?

--------------79DC5DFFA97F19C7AEF4FFB2--