It's possible copy many PostgreSQL tables into one file?

596 Views Asked by At

Is there possibility to copy (In loop) many tables into one csv file?

Command copy overwrite file so I get only last set of data... in file:

execute 'COPY (select * from '||source_table_name||' order by time) to ''F:/csv/rap/'||source_file_name||'.csv'' with DELIMITER '';'' CSV HEADER';

I know that could write it into one table and copy to csv but it would be over 68 000 tables to copy to almost 2 000 files so I would like avoid that.

0

There are 0 best solutions below