gpt4 book ai didi

postgresql - 将数据从 postgres 卸载到 s3

转载 作者:行者123 更新时间:2023-11-29 11:31:34 25 4
gpt4 key购买 nike

我正在尝试将表数据从 postgres 数据库卸载到 amazon s3。

我知道 redshift 有一个卸载到 s3 的选项 - 因为 redshift 是一个 postgres 数据库,我尝试在我的 postgres 数据库中使用相同的命令但没有成功。

有人可以帮我定期将表数据从 postgres 卸载到 s3 吗?

最佳答案

Redshift 基于 PostgreSQL 克隆,但不存在 1-1 特征对应关系。如果您想通过 S3 将数据从 PostgreSQL 数据库加载到 Redshift,您应该:

  1. 将您的数据从 PostgreSQL 卸载到 CSV 文件。为此,请使用 psql 的复制命令。另请参阅此问题 here .
  2. 将 CSV 文件复制到 S3 上。有不同的方法可以做到这一点,但请查看文档 here
  3. 使用COPY命令将数据从 S3 加载到 Redshift

关于postgresql - 将数据从 postgres 卸载到 s3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42712070/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com