When copying data from a file, you get the number of lines in psql using the "command tag":
db=# COPY t FROM '/var/lib/postgres/test.sql'; COPY 10
I need the number of rows and would like to avoid the excess count() in the table.
Is there a way to get this score from COPY directly in the PL / pgSQL function?
As far as I know, they are not, but maybe I'm missing something?
For PostgreSQL 9.2. But any option in any version will be of interest.
source share