Re: Column Redaction

From: Damian Wolgast <damian(dot)wolgast(at)si-co(dot)net>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Column Redaction
Date: 2014-10-10 09:34:53
Message-ID: D05D9583.14F87%damian.wolgast@si-co.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>This would have other uses as well, such as default report formats, so
>we can store financial amounts as NUMERIC, but format them on
>retrieval as $12,345.78 etc..

Nice idea, but what if you need to do further calculations?
If you output the value of credit card transactions it works fine, but in
case you want to SUM up the values, then you need to cast it back from
text(?) to numeric, calculate it and cast it to text(?) again?
And if you do - for any reason - need the credit card number in your
application (for example sending it to the credit card company to deduct
money) how can you retrieve it¹s original value?

Moreover, if you SELECT from a sub-SELECT which already has the formatted
information and not the plain data?

Maybe you should restrict access to tables for a certain user and only
allow the user to use a view which formats the output.

Modern applications do have a presentation layer which should take care of
data formatting. I am not sure if it is a good idea to mix data storage
and data presentation in the database.

Regards,
Damian Wolgast (irc:asymetrixs)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2014-10-10 09:37:31 Re: alter user set local_preload_libraries.
Previous Message Heikki Linnakangas 2014-10-10 09:29:01 Re: Column Redaction