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

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.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source