kullanarak cities_id_seq dizisi için izin reddedildi Postgre'de (ve veritabanı bilgi sistemlerinde) tamamen yeniyim.HATA: izin PostGres
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;
kullanıcı www, çalışmak gibi zaman:
aşağıdaki hatayıinsert into cities (name) values ('London');
Ben olsun: Ben
ERROR: permission denied for sequence cities_id_seq
olsun benim veritabanında sql komut aşağıdaki ran Sorun seri tipinde yatıyor. Bu yüzden, * _id_seq için www için seçme, ekleme ve silme haklarım var. Yine de bu benim sorunumu düzeltmez. Neyi kaçırıyorum? diziler için bu ayrıcalık currval ve nextval işlevlerin kullanılmasına olanak -
GRANT USAGE, SELECT ON SEQUENCE cities_id_seq TO www;
VERME KULLANIMI:
Sırayla ekleme/silme işlemi bana mantıklı gelmiyor. İşe bile şaşırmıştım. –