Use ' for inline SQL strings to avoid escaping
Fix pkgdb_get_pattern_query() for specifying origins