From: | Peter Geoghegan <pg(at)heroku(dot)com> |
---|---|
To: | pgsql-bugs <pgsql-bugs(at)postgresql(dot)org> |
Cc: | Stephen Frost <sfrost(at)snowman(dot)net> |
Subject: | RLS bug? |
Date: | 2015-01-06 21:52:04 |
Message-ID: | CAM3SWZTitxzNhwhCDwDHUVf6R-rg+FZGn-jxSoPxjaaJn3jzZA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Example session, from master branch:
postgres=# create table rowtest (key int4 primary key, val text);
CREATE TABLE
postgres=# alter table rowtest enable row level security;
ALTER TABLE
postgres=# create role bob;
CREATE ROLE
postgres=# CREATE POLICY test ON rowtest
FOR INSERT
TO bob
WITH CHECK (key % 3 = 0 );
CREATE POLICY
postgres=# CREATE POLICY test2 ON rowtest
FOR UPDATE
TO bob
WITH CHECK (key % 2 = 0 );
CREATE POLICY
postgres=# \d rowtest
Table "public.rowtest"
Column | Type | Modifiers
--------+---------+-----------
key | integer | not null
val | text |
Indexes:
"rowtest_pkey" PRIMARY KEY, btree (key)
Policies:
POLICY "test" FOR INSERT
TO bob
WITH CHECK ((key % 3) = 0)
POLICY "test2"
TO bob
WITH CHECK ((key % 2) = 0)
Why is the policy "test2" not listed as applying only "FOR UPDATE"? If
this is the intended behavior, it is not consistent with the
documentation, which states: "Using UPDATE for a policy means that it
will apply to UPDATE commands".
--
Peter Geoghegan
From | Date | Subject | |
---|---|---|---|
Next Message | Inoue, Hiroshi | 2015-01-07 00:03:16 | Re: BUG #12328: can't install the postgresql |
Previous Message | Francisco Olarte | 2015-01-06 18:52:28 | Re: BUG #12320: json parsing with embedded double quotes |