Re: leaky views, yet again - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: leaky views, yet again
Date
Msg-id 4CAB1ABA0200002500036539@gw.wicourts.gov
Whole thread Raw
In response to Re: leaky views, yet again  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.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,
isaddrsealedboolean 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 *
fromsealedaddrauth       where userid = current_user)     then '*** SEALED ***'     else address   end as address,
isaddrsealedfrom 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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: standby registration (was: is sync rep stalled?)
Next
From: Robert Haas
Date:
Subject: Re: leaky views, yet again