Re: What is the benefit of schemas?

From: Mikael Carneholm <carniz(at)spray(dot)se>
To: pgsql-general(at)postgresql(dot)org
Cc: Berend Tober <btober(at)seaworthysys(dot)com>
Subject: Re: What is the benefit of schemas?
Date: 2003-02-03 21:53:58
Message-ID: 1044309238014030@lycos-europe.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> ------- Ursprungligt meddelande -------
>
> Från: Berend Tober <btober(at)seaworthysys(dot)com>
> Datum: Mon, 3 Feb 2003 16:28:43 -0500 (EST)
>
>
> why would you have your customers in a
>separate database from an application table that had to reference the
>customer ID primary key value (CustomerID) from a differnet database?

It's more the other way around: why would you like to have tables for different applications in the same database? Over time, you will get more and more applications and more and more tables, and (talking pre 7.3), the only way to get referential integrity was to put all tables in the same database. Post 7.3, you no longer have to put tables in the same database in order to re-use data from your previous apps.

I demonstrated the pre 7.3 "no referential integrity while keeping it well organized" issue in my first reply by doing two separate connections to two different databases, as that's how you had to do it previous to 7.3 if you wanted to keep things tidy.

As a former Oracle developer, I can tell you that schemas are a essential part of reusability (in Oracle, at least), and I'm very happy that Postgres now provides the same functionality.

A good design (IMHO) is to have a 1-1 relationship between app-db-schema-dbuser, i.e. appFoo connects as userFoo to dbFoo and uses tables in the schemaFoo schema. New applications gets new users, new databases and new schemas, and are granted usage to objects in other databases through the use of schemas. Reusability is the keyword!

_____________________________________________________________
Här börjar internet!
Skaffa gratis e-mail och gratis internet på http://www.spray.se

Träffa folk från hela Sverige på ett och samma ställe - http://chat.spray.se/

Browse pgsql-general by date

  From Date Subject
Next Message Patric Bechtel 2003-02-03 21:55:17 Re: 335 times faster (!) [Viruschecked] [Viruschecked]
Previous Message Tom Lane 2003-02-03 21:50:15 Re: Error: heap_mark4update: (am)invalid tid