postgresql - Append and Overwrite in Amazon Redshift -


as redshift based on postgresql, have option overwrite or append data in table while copying s3 redshift?

only thing got use of triggers don't accept argument.

all need write script takes argument yes/no (or similar) if data in table.

when loading data amazon s3 amazon redshift using copy command, data appended target table.

redshift does not have "overwrite" option. if wish replace existing data data being loaded, could:

  • load data temporary table
  • delete rows in main table match incoming data, eg:

    delete main-table id in (select id temp-table)

  • copy rows temporary table main table, eg:

    select * temp-table main-table

see: updating , inserting new data


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -