Skip to content

Instantly share code, notes, and snippets.

@nurey
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nurey/ec37982ef33d82a9d9d8 to your computer and use it in GitHub Desktop.
Save nurey/ec37982ef33d82a9d9d8 to your computer and use it in GitHub Desktop.
has_locker
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