Created
May 16, 2012 18:33
-
-
Save empiricalthought/2712855 to your computer and use it in GitHub Desktop.
PL/Python exception bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create function python_exception_bug() | |
returns void as $$ | |
raise plpy.spiexceptions.InvalidParameterValue() | |
$$ language 'plpython3u'; | |
create function python_exception_sql() | |
returns text as $$ | |
begin | |
select python_exception_bug(); | |
return 'cannot happen'; | |
exception when invalid_parameter_value then | |
return 'expected behavior'; | |
when others then | |
return 'this is a bug'; | |
end | |
$$ language 'plpgsql'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment