如何将数据文件从 s3 导入 postgresql rds

编程入门 行业动态 更新时间:2024-10-26 00:18:56
本文介绍了如何将数据文件从 s3 导入 postgresql rds的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我对 AWS 和 Postgresql 非常陌生.

I am very new to AWS, and Postgresql.

  • 我创建了一个 Postgresql 数据库(在 aws 上使用 rds)
  • 我已将多个文档上传到多个 s3 存储桶
  • 我正在运行 EC2(Amazon Linux 64 位)
  • 我尝试使用数据管道,但 Postgres 似乎没有可用的(模板).我不知道如何连接到我的 RDS 实例并从 postgres 导入/导出数据.

    I tried to use a data pipeline, but nothing seems to be available (template) for Postgres. I can't figure out how to connect to my RDS instance and import/export data from postgres.

    我假设我可以使用 EC2 从我的 S3 存储桶中抓取并导入到 Postgres,而不是没有可用的数据管道模板.如果可能的话,我不知道如何.. 如果可能,请告知..

    I assumed that I could use EC2 to grab from my S3 bucket and import into Postgres in lieu of no data pipeline template being available. If it is possible I have no idea how.. Please advise if possible..

    推荐答案

    S3 -> RDS 直接加载现在可以用于 PostgreSQL Aurora 和 RDS PostgreSQL >= 11.1 作为 aws_s3 扩展.

    S3 -> RDS direct load is now possible for PostgreSQL Aurora and RDS PostgreSQL >= 11.1 as aws_s3 extension.

    • 兼容 PostgreSQL 的 Amazon Aurora 支持从 Amazon S3 导入数据
    • Amazon RDS for PostgreSQL 现在支持从 Amazon S3 导入数据

    参数类似于PostgreSQL COPY命令

    psql=> SELECT aws_s3.table_import_from_s3( 'table_name', '', '(format csv)', 'BUCKET_NAME', 'path/to/object', 'us-east-2' );

    请注意,此功能不适用于旧版本.

    Be warned that this feature does not work for older versions.

    更多推荐

    如何将数据文件从 s3 导入 postgresql rds

    本文发布于:2023-10-17 12:55:50,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1500963.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何将   文件   数据   rds   postgresql

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!