Created
November 5, 2014 20:39
-
-
Save nurey/b939843eef094064a935 to your computer and use it in GitHub Desktop.
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 or replace function json_maintenance(field json) returns numeric as | |
$$ | |
BEGIN | |
select json_extract_path_text($1, 'maintenance')::numeric(6,2); | |
EXCEPTION WHEN others THEN | |
RETURN null; | |
END | |
$$ | |
language plpgsql strict; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment