From: | "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> |
---|---|
To: | "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "KaiGai Kohei" <kaigai(at)ak(dot)jp(dot)nec(dot)com>, "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>, "Itagaki Takahiro" <itagaki(dot)takahiro(at)gmail(dot)com>, "KaiGai Kohei" <kaigai(at)kaigai(dot)gr(dot)jp>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: leaky views, yet again |
Date: | 2010-10-05 17:31:54 |
Message-ID: | 4CAB1ABA0200002500036539@gw.wicourts.gov |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> What is the use case for the status quo?
Much simplified:
create table party
(
countyno smallint not null,
caseno varchar(14) not null,
partyno smallint not null,
name text not null,
address text,
isaddrsealed boolean not null,
primary key (countyno, caseno, partyno)
);
create table sealedaddrauth
(
userid text not null primary key
);
create view partyview as
select countyno, caseno, partyno,
case
when isaddrsealed and not exists
(select * from sealedaddrauth
where userid = current_user)
then '*** SEALED ***'
else address
end as address,
isaddrsealed
from party
;
insert into party values (1,'2010FA000123',1,'Jane Doe',
'123 Victim Ave., Anytown, WI 53599',true);
insert into party values (1,'2010FA000123',2,'John Doe',
'123 Stalker St., Hometown, WI 53666',false);
-- Kevin
From | Date | Subject | |
---|---|---|---|
Next Message | Massa, Harald Armin | 2010-10-05 17:39:36 | Re: querying the version of libpq |
Previous Message | Robert Haas | 2010-10-05 17:29:47 | Re: standby registration (was: is sync rep stalled?) |