The next revision is attached.
Nikita made code and documentation improvements, renamed functions
from "jsonpath_" prefix to "jsonb_path_" prefix. He also renamed
jsonpath_predicate() to jsonb_path_match() (that looks better for me
too).
I've further renamed jsonb_query_wrapped() to jsonb_query_array(), and
changed that behavior to always wrap result into array. Also, I've
introduced new function jsonb_query_first(), which returns first item
from result.
------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company