On Mon, Jul 4, 2011 at 7:21 PM, Luke <[email protected]> wrote:
> On Mon, 4 Jul 2011, Chris Travers wrote:
>
>> CREATE TABLE file_storage (
>> content bytea,
>> mime_type int,
>> id serial not null unique,
>> PRIMARY KEY (content, mime_type),
>> );
>
> Aside from everything:
>
> Should mime_type be an int?  What are you going to be putting in it?
>
> How can we be sure that the referent of that int doesn't change at some
> later date?

PostgreSQL's referential integrity checking will prevent a change to
any foreign key that is currently referenced.  If we wanted to, we
could cascade changes, but I prefer not to do that unless absolutely
needed.

One can create additional x- mime types as needed.  We'd probably have
to have a lookup table anyway, and int's would use less space.  Not
unless we want to treat text/htlm as a valid MIME type ;-)

Best wishes,
Chris Travers

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Ledger-smb-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel

Reply via email to