From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | jian he <jian(dot)universality(at)gmail(dot)com> |
Cc: | Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Erik Rijkers <er(at)xs4all(dot)nl>, Michael Paquier <michael(at)paquier(dot)xyz>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, DUVAL REMI <REMI(dot)DUVAL(at)cheops(dot)fr>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: proposal: schema variables |
Date: | 2024-12-20 12:53:20 |
Message-ID: | CAFj8pRABA6q1crR35qusvcTy3tfrxAJ_9+b+e3DE0CBQSkTZGA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-performance |
Hi
----------------<<<>>>>-----------------------------
>> CREATE VARIABLE IF NOT EXISTS v2 AS comp;
>> grant update on variable v2 to alice;
>> set role alice;
>> LET v2.a = 12; --acl permission error
>> LET v2.b = 12; --acl permission error
>> LET v2 = (11,12); --ok.
>>
>
>
>
>>
>> not sure this is the desired behavior, for composite type variables, you
>> are
>> allowed to change all the values, but you are not allowed to update the
>> field
>> value of the composite. The following are normal table test update cases.
>>
>> create type comp as (a int, b int);
>> create table t2(a comp);
>> insert into t2 select '(11,12)';
>> grant update (a ) on t2 to alice;
>> set role alice;
>> update t2 set a.a = 13; --ok
>> update t2 set a.b = 13; --ok
>> update t2 set a = '(11,13)'; --ok
>>
>
> I think this is a bug, but I need more time for investigation. For field
> update you need to read the content
> the variable, but you are missing SELECT right on the variable, and then
> the LET fails. Unfortunately
> this is done inside the executor, so it is harder to fix it.
>
>
I fixed this issue - the change is done in Patch 02
Reards
Pavel
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2024-12-20 14:03:17 | Re: downgrade some aclchk.c errors to internal |
Previous Message | Jakub Wartak | 2024-12-20 12:25:41 | Re: FileFallocate misbehaving on XFS |
From | Date | Subject | |
---|---|---|---|
Next Message | Jon Zeppieri | 2024-12-20 21:01:57 | Re: Why a bitmap scan in this case? |
Previous Message | Frédéric Yhuel | 2024-12-20 09:57:40 | Re: Why a bitmap scan in this case? |