Last active
August 29, 2015 14:09
-
-
Save nurey/ec37982ef33d82a9d9d8 to your computer and use it in GitHub Desktop.
has_locker
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 has_locker(field json) | |
RETURNS boolean | |
LANGUAGE sql | |
AS $function$ | |
select | |
case json_extract_path_text($1, 'locker') | |
when 'None' then false | |
when 'No' then false | |
when NULL then false | |
else true | |
end | |
$function$ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment