Skip to content

Instantly share code, notes, and snippets.

@cloud8421
Created March 5, 2015 10:19
Show Gist options
  • Save cloud8421/8fe7b8dc8d4eed09bb18 to your computer and use it in GitHub Desktop.
Save cloud8421/8fe7b8dc8d4eed09bb18 to your computer and use it in GitHub Desktop.
yesql problematic query
SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc -> 'tags' ? 'qui';
@cloud8421
Copy link
Author

More info here: http://www.postgresql.org/docs/9.4/interactive/datatype-json.html

In short: the ? is a valid operator that check for the existence of the tags key with qui value in a jdoc jsonb column. When used with yesql, it gets parsed as a positional argument. Is there anything I can do to avoid that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment