Re: exploiting features of pg to obtain polymorphism maintaining ref. integrity

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>, "PostgreSQL General \(\(EN\)\)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: exploiting features of pg to obtain polymorphism maintaining ref. integrity
Date: 2006-10-07 01:12:22
Message-ID: 20061007011222.42819.qmail@web31811.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Is there any good documentation, example, tutorial, pamphlet, discussion... to exploit pg
> features to obtain "polymorphic" behavior without renouncing to referential integrity?
>
> Inheritance seems *just* promising.
>
> Any methodical a approach to the problem in pg context?

I don't know if this is what you are after, but is was a VERY interesting discussion that sounds
similar to what your are looking for?

http://archives.postgresql.org/pgsql-sql/2006-05/msg00179.php
http://archives.postgresql.org/pgsql-general/2006-05/msg01125.php

basically the OP, wanted to create a template/parent schema.

next he would create a new schema for each client and then create inherited tables from the parent
schema.

Then he would create views/fuctions that would work on the tables in the current schema.

Last he would set the search_path to the schema of any client of enterest and use the default
views/funtions of the newly set search_path of currently set schema.

One advantage (possible the polymorphism you were looking for) with this design was that any
modifications made to the template/parent schema would cascade to all of the client schemas as a
feature of table inheritance. And he could also summarize all of the data from all clients by
selecting from the template/parent schema.

Regards,

Richard Broersma Jr.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Talha Khan 2006-10-07 01:41:48 Re: shared_buffer setting
Previous Message Tom Lane 2006-10-06 21:33:45 Re: how to check SQLSTATE