Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ASW Commons/S3库将数据从RDS实例导入PostgreSQL 11.1时出现问题_Postgresql_Amazon Web Services_Amazon Rds - Fatal编程技术网

使用ASW Commons/S3库将数据从RDS实例导入PostgreSQL 11.1时出现问题

使用ASW Commons/S3库将数据从RDS实例导入PostgreSQL 11.1时出现问题,postgresql,amazon-web-services,amazon-rds,Postgresql,Amazon Web Services,Amazon Rds,我已经做了很长时间的实验,阅读了一些帖子和文档,但没有取得很大的效果,但是我在从S3导入PostgreSQL时遇到了一个编码问题。我们升级了数据库并将其移动到RDS,以便能够使用此功能,但我对PostgreSQL和AWS都是相当陌生的,并且正在与之斗争。我正在跑步: 亚马逊RDS上的PostgreSQL 11.1 DBeaver 6.1.5作为客户端 考虑到这个简单的脚本,现在作为客户机在DBeaver的SQL查询中运行,我无法让它工作,并且尝试了很多事情。这也是我关于堆栈溢出的第一篇文章

我已经做了很长时间的实验,阅读了一些帖子和文档,但没有取得很大的效果,但是我在从S3导入PostgreSQL时遇到了一个编码问题。我们升级了数据库并将其移动到RDS,以便能够使用此功能,但我对PostgreSQL和AWS都是相当陌生的,并且正在与之斗争。我正在跑步:

  • 亚马逊RDS上的PostgreSQL 11.1
  • DBeaver 6.1.5作为客户端
考虑到这个简单的脚本,现在作为客户机在DBeaver的SQL查询中运行,我无法让它工作,并且尝试了很多事情。这也是我关于堆栈溢出的第一篇文章


declare s3_uri varchar(128);
 begin
  SELECT aws_commons.create_s3_uri(
  'aduro-data-dev',
   'semarchy/inbound/reference_data/AffiliateType.csv',
   'us-west-2'
 ) as s3_uri --\gset;

raise notice 's3_uri=[%]', s3_uri;

SELECT aws_s3.table_import_from_s3(
   'aduro_extensions.sa_affiliate_type_import ', '', '(format csv)',
   's3_uri', 
   aws_commons.create_aws_credentials('removed ', 'removed', '')
);

end $$
当我运行上述操作时,我得到以下错误:

SQL错误[42601]:错误:查询没有结果数据的目标 提示:如果要放弃选择的结果,请改用“执行”。 其中:PL/pgSQL函数内联\代码\块SQL语句第5行

我所尝试的:

  • “\gset”命令来自AWS示例,用于执行此操作,但如果我将其放在那里,则会导致语法错误,因此会将其注释掉,我认为这是因为它更多地用于命令行界面。它应该将SELECT生成的复合值放入s3_uri变量中

  • 如果我将“)作为s3_uri--\gset;“to”)的行更改为s3_uri--\gset;”,则错误将更改为:

SQL错误[22P02]:错误:格式错误的记录文字:“s3_uri” 细节:缺少左括号。 其中:PL/pgSQL函数内联\代码\块SQL语句第13行

S3_uri值的RAISE语句的输出如下所示:

00000: s3_uri=[("(aduro-data-dev,semarchy/inbound/reference_data/AffiliateType.csv,us-west-2)")]