No, you can't use SQL to query a data object which isn't in the database.
Desktop could of course execute such a query, but it would be done in the
ArcGIS execution space (iterating the shapefile rows), and the shapefile
access wouldn't be done with SQL.
If your PG database was enabled as enterprise geodatabase (had ArcSDE
and the SDE.ST_GEOMETRY type installed), then it would be trivial to use
ArcGIS to load the shapefile into PostgreSQL, but without that you'll need
to rely on non-Esri tools like gdal or 'shp2pgsql'.
If the temp table is small enough, you could union the geometries, generate
well-known text from the result, and use that as a WHERE clause constraint
(that would be more efficient than a compound query anyway).
- V