问题描述
我尝试使用aws_s3扩展名将csv文件从s3存储桶中导入postgres aurora rds。当我在psql控制台上执行该操作时,它首先发生错误,然后成功。为什么它首先出现错误?
$ psql -h 127.0.0.1 -p 5432 -U user mydb
Password for user mydb:
psql (12.2,server 11.7)
SSL connection (protocol: TLSv1.2,cipher: ECDHE-RSA-AES256-GCM-SHA384,bits: 256,compression: off)
Type "help" for help.
mydb=> select *
from aws_s3.table_import_from_s3(
'my_table','','(format csv,header false)',aws_commons.create_s3_uri(
'my_bucket',format('imports/%s/my_file.csv','sub_dir'),'ap-northeast-1'
)
);
ERROR: Unable to complete COPY from S3,HTTP error code: 168
CONTEXT: SQL function "table_import_from_s3" statement 1
mydb=>
mydb=>
mydb=> select *
from aws_s3.table_import_from_s3(
'my_table',format('imports/%s/my_csv.csv','ap-northeast-1'
)
);
table_import_from_s3
------------------------------------------------------------------------------------------------------------------------
18638 rows imported into relation "my_table" from file imports/sub_dir/my_file.csv of 2033585 bytes
(1 row)
重复发生这种陌生现象。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)