英文:
Redshift UNLOAD command with extension parameter throws syntax error
问题
以下是您要翻译的内容:
"我正在尝试使用extension
参数从Redshift中卸载数据,以指定CSV文件扩展名。CSV扩展名对于允许数据文件在电子表格软件中打开非常有用。
我运行的命令是:
unload ('select * from public.mytable')
to 's3://mydomain/fZyd6EYPK5c/data_'
iam_role 'arn:aws:iam::xxxxxxx:role/my-role'
parallel off
format csv
extension '.csv.gz'
gzip
allowoverwrite;
这个命令抛出一个错误消息:
SQL错误[42601]:ERROR: 在或者靠近“extension”处有语法错误
看起来extension
选项未被识别。我相信我已经遵循了官方文档和示例:
https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html
https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD_command_examples.html
select version();
PostgreSQL 8.0.2 on i686-pc-linux-gnu,由GCC编译,GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3),Redshift 1.0.44903
我正在从Java应用程序和DBeaver中测试查询。我在查询中是否有语法错误?这可能是Redshift的错误吗?在AWS论坛上提出了问题。期待回复。
英文:
I am attempting to unload data from Redshift using the extension
parameter to specify a CSV file extension. The CSV extension is useful to allow data files to be opened e.g. in spreadsheet software.
The command I run is:
unload ('select * from public.mytable')
to 's3://mydomain/fZyd6EYPK5c/data_'
iam_role 'arn:aws:iam::xxxxxxx:role/my-role'
parallel off
format csv
extension '.csv.gz'
gzip
allowoverwrite;
This command throws an error message:
SQL Error [42601]: ERROR: syntax error at or near "extension"
It appears that the extension
option is not recognized. I believe I have followed the official documentation and examples:
https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html
https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD_command_examples.html
select version();
PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.44903
I am testing the query from a Java application and from DBeaver.
Do I have a syntax error in my query? Could this be a Redshift bug? Asked on AWS forum. Replies appreciated.
答案1
得分: 1
结果表明,扩展功能尚未部署到我的Redshift集群中。在AWS论坛上询问后,得知该参数在版本1.0.45698之后可用。
扩展参数是最近发布的一个功能,在版本1.0.45698之后可用。您看到此错误是因为您的集群版本1.0.44903低于此版本。请等待下一个维护窗口或尝试创建一个新的集群/工作组以获取更新的版本。集群版本和发布的功能在以下页面中有记录。
英文:
It turns out the extension feature was not rolled out to my Redshift cluster yet. Asked on the AWS forum and the parameter is available after version 1.0.45698.
> Extension parameter is a feature released recently and it's available after version 1.0.45698. You are seeing this error since your cluster version 1.0.44903 is lower than this. Please wait until next maintenance window or try creating a new cluster/workgroup to get the updated version. Cluster versions and released features are documented in following page.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论