SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Stop script execution after error

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Stop script execution after error
Author Message
michalk



Joined: 29 Aug 2014
Posts: 211

Post Stop script execution after error Reply with quote
Is there a way to set SA to guarantee stopping a script execution in case of error?

For example this snippet

Code:
DO LANGUAGE plpgsql $$
BEGIN
   
    RAISE NOTICE 'a';
   
END $$;

DO LANGUAGE plpgsql $$
BEGIN
   
    RAISE EXCEPTION 'b';
   
END $$;


DO LANGUAGE plpgsql $$
BEGIN
   
    RAISE NOTICE 'c';
   
END $$;


Returns:
Code:
Executing selected queries... Please wait or close this tab to cancel execution.
NOTICE: a;
Context: PL/pgSQL function inline_code_block line 4 at RAISE
SQL State: P0001,  ERROR: b;
Context: PL/pgSQL function inline_code_block line 4 at RAISE
NOTICE: c;
Context: PL/pgSQL function inline_code_block line 4 at RAISE
The command(s) completed with errors (26.28 ms).


IMO it shouldn't work this way
I was looking for some switch, configuration setting but without success.

with regards
Mon Jul 16, 2018 5:29 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
There is an option in the Options dialog -> DB Options -> PostgreSQL -> Abort Execution on Error. By default it's set to No. It sounds like you want Yes. Please try changing that option.
Mon Jul 16, 2018 8:05 am View user's profile Send private message
michalk



Joined: 29 Aug 2014
Posts: 211

Post Reply with quote
Do you mean DB Options of SA?
I cannot see "Abort Execution on Error", see screenshot.
I expect this option is SA Editor specific. But I found no such option in the Editor too.


Mon Jul 16, 2018 8:46 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
My apologies, I didn't realize I'm looking at more recent version, which isn't yet out of development stage. Indeed there is no such option in 9.5. Please wait for a little while. Version 10 is expected in a few weeks from now.
Mon Jul 16, 2018 9:22 am View user's profile Send private message
michalk



Joined: 29 Aug 2014
Posts: 211

Post Reply with quote
Thank you.
I cannot wait for new ver.

regards
Mon Jul 16, 2018 9:24 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.