Need a sanity check with EAV

From: Adam Brusselback <adambrusselback(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Need a sanity check with EAV
Date: 2014-08-13 14:51:51
Message-ID: CAMjNa7cdMOVCXayH+d2SN4arzdh97mPmzkE9xCiU-6Udbp6=yA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hey all,

I just wanted to get the opinion of people who've been there before and
have more experience than I on the solution I came up with.

I've got an application, everything used by the application is stored in a
strictly relational model, but I wanted to allow users to add additional
data capture points to a few specific types of data (company records,
product records, etc). I still wanted to ensure type safety, uniqueness,
prevent orphan rows, etc.

None of this data will be reported on in standard reports, as these data
points could be different for each client. Additionally, none of the data
will drive any application logic. It will just be available to view, and
sent back to the customer in a feed with the rest of their data if they
wanted to create their own reports.

I designed a kinda EAV schema for this, and was looking for a quick review.
I just want to see if I am way off base, or if there are any gotchas I may
not know about, etc. It's been working perfectly fine for me, but this
isn't a production application yet.

Schema can be found on this pastebin: http://pastebin.com/dNifqApT

Also, if anyone knows a better way to do that check constraint on my
product_value table, i'd appreciate it.

Thank you in advance for any insight,
-Adam Brusselback

Browse pgsql-novice by date

  From Date Subject
Next Message David G Johnston 2014-08-13 14:58:11 Re: tuple compare involving NULL
Previous Message Albe Laurenz 2014-08-13 14:44:14 Re: tuple compare involving NULL