Re: Need help with a function boolean --> text or array - Mailing list pgsql-novice

From Andreas
Subject Re: Need help with a function boolean --> text or array
Date
Msg-id 47974A35.8050802@gmx.net
Whole thread Raw
In response to Re: Need help with a function boolean --> text or array  ("Andrej Ricnik-Bay" <andrej.groups@gmail.com>)
Responses Re: Need help with a function boolean --> text or array
List pgsql-novice
Andrej Ricnik-Bay wrote:
> On 23/01/2008, Andreas <maps.on@gmx.net> wrote:
>
>> My view should look like this:
>> id, name, addons
>> ...
>> 11, 'Salami',  'Cheese, Salami'
>> 42, 'Fire',  'Cheese, Onion, Salami, Extra hot chilies'
>> ...
>>
> Looks primarily like a normalisation problem to me.  I'd be
> going for a pizzaname-table, an ingredient-table and a pizza-table
> that combines these m:n and then worry about the view ...
>

The pizza-table was a rather simplified example.
The real table is a questinnaire that has a number of single fields and
some distinct groups of booleans.
For easy reading some of those boolean-groups should be rolled into one
text field each but additionally every boolean should still appear as
single column, too.
It wasn't my idea. I just do the dirty work.   ;)

Further normalisation would run me into crosstab issues and this is also
a white spot for me.
Could you give me a sketch how a good design would represent such a
questinnaire?
I understand the m:n approach.
My problem would rather be how to get a big view out of this m:n design.

The current design also is ambiguous in the aspect that the frontend-app
just knows boolean as Yes/No so TRUE=Yes but FALSE could be No as well
as Unknown.


Regards
Andreas

pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: using column alias to make operations
Next
From: "Andrej Ricnik-Bay"
Date:
Subject: Re: Need help with a function boolean --> text or array