Skip to content

Instantly share code, notes, and snippets.

@empiricalthought
Created May 16, 2012 18:33
Show Gist options
  • Save empiricalthought/2712855 to your computer and use it in GitHub Desktop.
Save empiricalthought/2712855 to your computer and use it in GitHub Desktop.
PL/Python exception bug
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