 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
Stop script execution after error |
|
Is there a way to set SA to guarantee stopping a script execution in case of error?
For example this snippet
 |
 |
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:
 |
 |
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
|
|
Thank you.
I cannot wait for new ver.
regards
|
|
Mon Jul 16, 2018 9:24 am |
|
 |
|
|
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
|
|
|