| From: | Henrik Aagaard Sørensen <henrikaagaardsorensen(at)gmail(dot)com> |
|---|---|
| To: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Implementing SCD Type 2. |
| Date: | 2013-04-02 08:42:48 |
| Message-ID: | CAGH8SeZwopCE9nopUUut2W-X=CKE=pNuqfwvrr-MVYiYrsKRdA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
I'm new to PostgreSQL and this is my first post to this mailing-list.
Hopefully it's ok.
I've searched through the archives (and Google), without any result.
I'm looking into implementing SCD Type 2 in PostgreSQL:
http://en.wikipedia.org/wiki/Slowly_changing_dimension
with the approach of having valid_from and valid_to fields in a table.
Can anyone help me out with constraints, checks etc. for such a solution?
My table should contain the following columns:
user_id
email_address
valid_from
valid_to
where an user can change e-mail address.
I'm implementing updates etc. via a API, however, I would like to have the
table secured for invalid data, overlap etc.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bastiaan Olij | 2013-04-02 12:48:58 | Re: about .pgpass |
| Previous Message | Tom Lane | 2013-03-31 03:16:38 | Re: Cannot create perlplu function |