Re: Question regarding keyword checkboxes in database design - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: Question regarding keyword checkboxes in database design
Date
Msg-id 20030608112236.GB14337@wolff.to
Whole thread Raw
In response to Question regarding keyword checkboxes in database design  (Lynna Landstreet <lynna@gallery44.org>)
List pgsql-novice
On Thu, Jun 05, 2003 at 14:00:16 -0400,
  Lynna Landstreet <lynna@gallery44.org> wrote:
>
> So I'm thinking that probably each set of keywords (medium, subject, etc.)
> probably needs to be a table and each keyword a boolean column within it,
> but I'm not sure if there's a way to modify a select statement so that it
> outputs the names of all columns with a yes/true/1 in them, rather than
> outputting the values themselves.

If the keywords are fixed then this is probably what you want to do.
If new ones can get added more than once in a great while, then you
may want to store the keywords and primary key of the parent record
they belong to in a separate table.

You can get the names of the columns programatically if you want to try
to make the web application relatively immune from changes when a new
keyword gets added. How you do this depends on what interface you are
using. It should be covered in the documentation for that interface.

pgsql-novice by date:

Previous
From: Jean-Christian Imbeault
Date:
Subject: Re: [bug?] oddity creating table with uppercase initial
Next
From: Joanne Formoso
Date:
Subject: Weird Database Encryption Bug