S3 is not a database. You will need to be more specific about '... then from the S3 it will be picked and gets merged to the target postgres database.'
The data from S3 will be dumped into the stage table and then the upsert/merge from that table to the actual table.