On Fri, Sep 10, 2004 at 11:52:26AM -0500, Murat Kantarcioglu wrote:
> Can you suggest me a solution to how to do
> this on Postgresql backend?
>
> I am asssuming that somewhere in the code, you are calling a function like
> getPage(Page_id)
> to retrieve the page(I am trying to change backend)
Probably the code you want to modify is in src/backend/storage/smgr.
Maybe you want to add a different storage manager (they are pluggable,
sort of).
> getPage(Page_id)
> {
> ctr=Hash_Table(Page_id) //return somevalue needed for deccryption
> Thread_Read(Page_id) // will call the original read code
> Thread_Encryption.start(ctr, length);
> when both threads are done finish the encryption
> }
I think it would need extensive, painful and unwelcome modifications to
use threads to do the job. You could just as well do it sequentially,
like in
encryptedPage = getPage(page_id);
clearPage = unencrypt(encryptedPage);
return clearPage;
And the reverse for storage. This may only need modifications to
mdread() and mdwrite() ... unless your encryption scheme returns a
different length than the original.
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Estoy de acuerdo contigo en que la verdad absoluta no existe...
El problema es que la mentira sí existe y tu estás mintiendo" (G. Lama)