I am writing some c code to transfer data from database_1, table_1 to database_2, table_2. I am quite new to postgresql and unable to figure out how to do this. I am using postgres-9.5
Is the below syntax correct?
psql database_1 -c 'COPY table_1 TO stdout' | psql database_2 -c 'COPY table_2 FROM stdin'
The intelligent guys here, please help me with the correct syntax. Thank you in advance!!