私はpostgres(およびデータベースインフォメーションシステム)の新機能です。ユーザーWWWようにしようとすると、エラー:Postgresを使用してcities_id_seqシーケンスの許可が拒否されました
create table cities (
id serial primary key,
name text not null
);
create table reports (
id serial primary key,
cityid integer not null references cities(id),
reportdate date not null,
reporttext text not null
);
create user www with password 'www';
grant select on cities to www;
grant insert on cities to www;
grant delete on cities to www;
grant select on reports to www;
grant insert on reports to www;
grant delete on reports to www;
grant select on cities_id_seq to www;
grant insert on cities_id_seq to www;
grant delete on cities_id_seq to www;
grant select on reports_id_seq to www;
grant insert on reports_id_seq to www;
grant delete on reports_id_seq to www;
:
insert into cities (name) values ('London');
私は次のエラーを取得:
ERROR: permission denied for sequence cities_id_seq
を私がすることを得る私は私のデータベースにSQLスクリプトを次のよう走りました問題はシリアルタイプにあります。だから私は* _id_seqの選択、挿入、削除の権利をwwwに与えているのです。それでも私の問題は解決しません。私は何が欠けていますか?あなたが使用する必要がPostgreSQLの8.2以降
シーケンスに挿入/削除を許可することは私には意味がありません。私はそれが機能することにも驚いています。 –