pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lewbloch@gmail.com
To: pgsql-sql@postgresql.org
Subject: Re: Select row cells as new columns
Date: Thu, 31 May 2012 09:55:27 -0700 (PDT)
Message-ID: <cadaa466-54ba-4678-ac75-afa8e9165c66@googlegroups.com> (raw)
In-Reply-To: <1337950654848-5710005.post@n5.nabble.com>
References: <1337936621862-5709987.post@n5.nabble.com>
	<862d618c8d42e3a0b300d1f7be966d77@neslonek.homeunix.org>
	<1337950654848-5710005.post@n5.nabble.com>

danycxxx wrote:
> Yes, I've looked at it, but id doesn't create the desired output. After more
> research I've found that I my design is similar to Entity, Attribute and
> Value(EAV) design and I think I have to redesign. Any suggestion regarding
> EAV? Is there any other approach?

EAV is controversial. I am uncomfortable with it because it implements 
keys as values.

I suggest that you not use EAV. Its putative flexibility comes at a large 
implementation price.

The other approach is relational database design. You model an entity as 
a collection of tables, each of which represents an aspect of the data 
pertinent to the entity. Each table has columns, the labels of which 
correspond generally to the names of attributes for that aspect. Each 
row of each table provides values for its respective named columns.

So a table roughly models what I'll call an "entitylet" - a cohesive piece 
of the entity model.

The rules to decompose entity models into relational data models 
constitute "normalization". I suggest you create a relational data model 
normalized to at least third normal form.

-- 
Lew



view thread (4+ messages)

Message-ID: <cadaa466-54ba-4678-ac75-afa8e9165c66@googlegroups.com>
Permalink:  ../cadaa466-54ba-4678-ac75-afa8e9165c66@googlegroups.com/
Also on:    postgresql.org/message-id/cadaa466-54ba-4678-ac75-afa8e9165c66@googlegroups.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lewbloch@gmail.com
  Subject: Re: Select row cells as new columns
  In-Reply-To: <cadaa466-54ba-4678-ac75-afa8e9165c66@googlegroups.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox