Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table.

Поиск
Список
Период
Сортировка
Искать
От
Amit Langote
Тема
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table.
Дата
в 09:36:00
Msg-id
CA+HiwqFd4Suq6XoKHNP9iZw5POBToyOub+f7Dh7urnPZR8wZCQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Getting ERROR with FOR UPDATE/SHARE for partitioned table. Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. amul sul <sulamul@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Amit Langote <amitlangote09@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. amul sul <sulamul@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Amit Langote <amitlangote09@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. amul sul <sulamul@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Amit Langote <amitlangote09@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Amit Langote <amitlangote09@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Amit Langote <amitlangote09@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Amit Langote <amitlangote09@gmail.com>
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>
On Thu, May 28, 2020 at 1:36 PM amul sul  wrote:
> On Wed, May 27, 2020 at 12:53 PM Amit Langote  wrote:
>> Actually, if you declare the cursor without FOR SHARE/UPDATE, the case
>> would fail even with traditional inheritance:
>>
>> drop table if exists p cascade;
>> create table p (a int);
>> create table c (check (a = 2)) inherits (p);
>> insert into p values (1);
>> insert into c values (2);
>> begin;
>> declare c cursor for select * from p where a = 1;
>> fetch c;
>> update p set a = a where current of c;
>> ERROR:  cursor "c" is not a simply updatable scan of table "c"
>> ROLLBACK
>>
>
> I am not sure I understood the point, you'll see the same error with declarative
> partitioning as well.

My point is that if a table is not present in the cursor's plan, there
is no way for CURRENT OF to access it.  Giving an error in that case
seems justified.

OTOH, when the CURRENT OF implementation has RowMarks to look at, it
avoids the error for traditional inheritance children due their
inactive RowMarks being present in the cursor's PlannedStmt.  I think
that's only by accident though.

-- 
Amit Langote
EnterpriseDB: http://www.enterprisedb.com


В списке pgsql-hackers по дате отправления
От: Kyotaro Horiguchi
Дата:
От: Amit Kapila
Дата:
FAQ