Export
COPY ... TO writes a table or any query to a file. Reading it back with COPY FROM into a one-column text table shows exactly what was written.
task
COPY the facilities table to /tmp/f.csv with a header, read the file back into f_back (one text column) and count its lines.