Query ArcGIS Online live from SQL — read-only — without materializing a thing.
For cases where you want a live, read-only view of an AGOL layer rather than a materialized copy, agol_fdw pairs with the ogr_fdw extension to expose the layer as a Postgres foreign table. You query it like any other table; reads are served live from AGOL.
ogr_fdw is an optional dependency — only enable it if you want live reads. Materialized tables work fully without it.
-- once an ogr_fdw foreign table is wired to an AGOL layer,
-- query it like any table — served live from ArcGIS Online:
SELECT status, count(*)
FROM agol_fdw_live.poles
GROUP BY status;