Re: Clarification on Role Access Rights to Table Indexes
От | Ayush Vatsa |
---|---|
Тема | Re: Clarification on Role Access Rights to Table Indexes |
Дата | |
Msg-id | CACX+KaO4R9QDxbPSxSB0jNXFsqA6Jf=UPS+tyUvT_YvuP_grVA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Clarification on Role Access Rights to Table Indexes (Nathan Bossart <nathandbossart@gmail.com>) |
Ответы |
Re: Clarification on Role Access Rights to Table Indexes
|
Список | pgsql-hackers |
> I'm wondering whether setting missing_ok to true is correct here. IIUC we
> should have an AccessShareLock on the index, but I don't know if that's
> enough protection.
> should have an AccessShareLock on the index, but I don't know if that's
> enough protection.
Since we are already opening the relation with rel = relation_open(relOid, AccessShareLock);
,
if relOid
does not exist, it will throw an error. If it does exist, we acquire an AccessShareLock
,
preventing it from being dropped.
By the time we reach IndexGetRelation()
, we can be confident that relOid
exists and is
protected by the lock. Given this, it makes sense to keep missing_ok = false
here.
Let me know if you agree or if you see any scenario where missing_ok = true
would be preferable—I can update the condition accordingly.
Thanks!
Ayush Vatsa
SDE AWS
В списке pgsql-hackers по дате отправления: