好的,所以我对RDS和AWS来说是相当新的,但是对于我来说,我的生活不能让我在笔记本电脑上创建的数据库到亚马逊RDS,我把它移动到了我的测试VPS,还有我的台式机没有任何问题,这里是我迄今为止所尝试的
create extension postgis; create extension fuzzystrmatch; create extension postgis_tiger_geocoder; create extension postgis_topology; alter schema tiger owner to rds_superuser; alter schema topology owner to rds_superuser; CREATE FUNCTION exec(text) returns text language plpgsql volatile AS $f$BEGIN EXECUTE $1; RETURN $1; END; $f$; SELECT exec('ALTER TABLE ' || quote_ident(s.nspname) || '.' || quote_ident(s.relname) || ' OWNER TO rds_superuser') FROM ( SELECT nspname,relname FROM pg_class c JOIN pg_namespace n ON (c.relnamespace = n.oid) WHERE nspname in ('tiger','topology') AND relkind IN ('r','S','v') ORDER BY relkind = 'S') s; GRANT ALL PRIVILEGES ON DATABASE testgetwork TO luke;
luke@l-xps:~$psql --host=myhost.dns.us-west-2.rds.amazonaws.com --port=5432 --username=luke --password --dbname=testgetwork < testgetwork.sql Password for user luke: SET SET SET SET SET ERROR: schema "topology" already exists ALTER SCHEMA CREATE EXTENSION ERROR: must be owner of extension plpgsql CREATE EXTENSION ERROR: must be owner of extension postgis CREATE EXTENSION ERROR: must be owner of extension postgis_topology <more output,removed to save space> ERROR: permission denied for relation spatial_ref_sys invalid command \. setval -------- 1 (1 row) setval <more output,removed to save space>
我的问题是,我该怎么办?所有的功能似乎被一个权限问题阻止,用户luke是rds_superuser组的一部分,任何有PostGis和RDS经验的人都知道如何纠正这个问题?
testgetwork=> \du List of roles Role name | Attributes | Member of ---------------+------------------------------------------------+----------------- luke | Create role,Create DB | {rds_superuser} rds_superuser | Cannot login | {} rdsadmin | Superuser,Create role,Create DB,Replication | {}