Re: CREATE TABLE with REFERENCE

From: Jonathan Bartlett <johnnyb(at)eskimo(dot)com>
To: Dmitry Tkach <dmitry(at)openratings(dot)com>
Cc: "kay-uwe(dot)genz" <kug1977(at)web(dot)de>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: CREATE TABLE with REFERENCE
Date: 2003-07-29 19:00:49
Message-ID: Pine.GSU.4.44.0307291147360.29931-100000@eskimo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Not *one* table. I never advocated that. It is perfectly normal to split
> your data into different tables *vertically* (i.e. things that do not
> have any intersection between their data, should go into different
> tables), but it very rarely (if at all) makes any sense to split it
> *horizontally* (so that identical columns sit in different tables, just

Okay, so I shouldn't merge the tables then. Let me show you my schema:

Sponsor -> object_id, name, url, representatvie (points to rep table),
city (points to city table), primary contact (points to contact table),
active

Payments -> object_id, sponsor (points to sponsor table), when_paid,
payment_type, payer_contact (points to contact table), company address
(points to addresses table), billing address (points to addresses table),
CC Info (I won't spell it all out for you), amount

Notes -> object_id, noted_object (points to ANY table), note_title,
note_text, note_creation_date, not_creator(points to user table), active

So, since Notes can be attached to any table, I don't see how you are
saying I should combine them, except to combine EVERYTHING into a single
table, and have a value at the beginning to use as the record "type".

> No. They would have a base class of "Object" (or whatever), and the
> 'notes' would be linked to the Object.
> This would in fact, be a *beatiful* solution... it's a shame really that
> it doesn't work.

As I said, the tool is limitted.

Jon

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Bartlett 2003-07-29 19:16:02 Re: CREATE TABLE with REFERENCE
Previous Message Dmitry Tkach 2003-07-29 18:26:45 Re: CREATE TABLE with REFERENCE