Re: Need help with a function boolean --> text or array

From: "Andrej Ricnik-Bay" <andrej(dot)groups(at)gmail(dot)com>
To: Andreas <maps(dot)on(at)gmx(dot)net>
Cc: ListaPostgre <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Need help with a function boolean --> text or array
Date: 2008-01-23 19:24:09
Message-ID: b35603930801231124u5a602fcfp8723b5d3956812c1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 24/01/2008, Andreas <maps(dot)on(at)gmx(dot)net> wrote:
> Andrej Ricnik-Bay wrote:
> > On 23/01/2008, Andreas <maps(dot)on(at)gmx(dot)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.
I think that Andreas' response to Philips question in
http://archives.postgresql.org/pgsql-sql/2007-12/msg00106.php
should get you started on the concatenation .... as for the design:
what is the cross-tab problem you'd see?

> 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.
That sounds dangerously stupid :}

> Regards
> Andreas
Cheers,
Andrej

--
Please don't top post, and don't use HTML e-Mail :} Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Robert Bernabe 2008-01-24 08:39:20 WITH ENCRYPTION
Previous Message Andreas 2008-01-23 14:07:49 Re: Need help with a function boolean --> text or array