Re: Database design: Storing app defaults

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Database design: Storing app defaults
Date: 2008-06-18 12:21:44
Message-ID: 20080618122144.GF2572@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 18, 2008 at 02:03:05PM +0200, David wrote:
> If I want to start providing user-customizable defaults to the
> database (ie, we don't want apps to update database schema), is it ok
> database design to add a table2 record, with a NULL table1_id field?
>
> 2) Have a new table, just for defaults, like this:
>
> table2_defaults
> - field1
> - field2
> - field3

Without knowing anything else about the problem, this is probably what
I'd do. The fact that the shape of the table is very similar to the
table specific defaults is only incidental. The main reason I'd do this
is because it's solving a different problem, that of providing global
defaults vs. table specific defaults.

I'm not sure how you'd get all the types to match up, but then again
this whole scheme of providing defaults seems a little alien to anything
I've done before.

Sam

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2008-06-18 12:30:05 Re: Controlling write access to a table
Previous Message Karsten Hilbert 2008-06-18 12:20:07 Re: Database design: Storing app defaults