FIX queries on environments_paths for PostgreSQL