### Steps to reproduce ``` SlaveDb.connection.execute("COPY (select * from table_name) TO '#{file_path}.csv' WITH CSV HEADER;") ``` ### Expected behavior it is possible to export data from replica database to csv file COPY TO - **readable sql** COPY FROM - **writable sql** https://www.postgresql.org/docs/9.2/sql-copy.html ### Actual behavior The following error is raised: ActiveRecord::ReadOnlyError: Write query attempted while in readonly mode ... ### System configuration **Rails version**: 6.0.2.2 **Ruby version**: 2.5.5