Improved PostgreSQL compatibility for saved searches.
Thanks to Michele Meloni.