Add ability to map raise errorcode/message to http status
This commit is contained in:
committed by
Steve Chávez
parent
d9a250d2cb
commit
38de56de4a
Vendored
+14
@@ -1292,6 +1292,20 @@ $$ language sql;
|
||||
create function test.many_inout_params(INOUT num int, INOUT str text, INOUT b bool DEFAULT true) AS $$
|
||||
select num, str, b;
|
||||
$$ language sql;
|
||||
|
||||
create or replace function test.raise_pt402() returns void as $$
|
||||
begin
|
||||
raise sqlstate 'PT402' using message = 'Payment Required',
|
||||
detail = 'Quota exceeded',
|
||||
hint = 'Upgrade your plan';
|
||||
end;
|
||||
$$ language plpgsql;
|
||||
|
||||
create or replace function test.raise_bad_pt() returns void as $$
|
||||
begin
|
||||
raise sqlstate 'PT40A' using message = 'Wrong';
|
||||
end;
|
||||
$$ language plpgsql;
|
||||
--
|
||||
-- PostgreSQL database dump complete
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user