用户在 Amazon redshift 数据库中获取 server_version 需要什么角色权限?

What role permission needed for the user to get the server_version in Amazon redshift DB?

目前我在 redshift 中有一个名为 masteruser,它具有超级用户权限。

analytics=# \du
                      List of roles
  Role name  |          Attributes           | Member of 
-------------+-------------------------------+-----------
 master      | Superuser, Create DB          | 
 qac         |                               | 
 rdsdb       | Superuser, Create DB         +| 
             | Password valid until infinity | 
 report_user |                               | 

但是当我执行 show server_version; 时,出现错误。

analytics=# show server_version;
ERROR:  must be superuser to examine "server_version"

为什么我要show_version? 我在 node.js 应用程序中使用 db-migrate node_module。但是当我尝试 运行 我的迁移脚本时,我遇到了上述错误。 这是我对 db-migrate 的详细说明:

sangeeth@sangeeth-kumar ~/Desktop/analytics-api $ ./node_modules/.bin/db-migrate up --config cfg/database.json --verbose
[INFO] Detected and using the projects local version of db-migrate. '/home/sangeeth/Desktop/analytics-api/node_modules/db-migrate/index.js'
[INFO] Using dev settings: { driver: 'pg',
  database: 'analytics',
  user: 'master',
  password: '******',
  host: '*****',
  port: '****' }
[INFO] require: db-migrate-pg
[INFO] connecting
[INFO] connected
[SQL] show server_version_num
[SQL] show server_version
[ERROR] error: must be superuser to examine "server_version"
    at Connection.parseE (/home/sangeeth/Desktop/analytics-api/node_modules/pg/lib/connection.js:553:11)
    at Connection.parseMessage (/home/sangeeth/Desktop/analytics-api/node_modules/pg/lib/connection.js:378:19)
    at Socket.<anonymous> (/home/sangeeth/Desktop/analytics-api/node_modules/pg/lib/connection.js:119:22)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:607:20)

注意:我使用的是 postgres(pg) 驱动程序,因为 redshift 是 postgres 合规性。

有人帮我吗?

不支持

SHOW server_version;。您需要修补库才能使用 SELECT version();

我会考虑将其明确列为本文档中不受支持的内容。 https://docs.aws.amazon.com/redshift/latest/dg/c_unsupported-postgresql-functions.html