From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Curt Sampson <cjs(at)cynic(dot)net> |
Cc: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Hannu Krosing <hannu(at)tm(dot)ee>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Why is MySQL more chosen over PostgreSQL? |
Date: | 2002-07-31 03:11:14 |
Message-ID: | 200207310311.g6V3BEG23450@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Curt Sampson wrote:
> On Wed, 31 Jul 2002, Christopher Kings-Lynne wrote:
>
> > > I highly doubt that. Relating two tables to each other via a key, and
> > > joining them together, allows you to do everything that inheritance
> > > allows you to do, but also more. If you have difficulty with keys and
> > > joins, well, you really probably want to stop and fix that problem
> > > before you do more work on a relational database....
> >
> > I'm still not convinced of this. For example, my friend has a hardware
> > e-store and every different class of hardware has different properties. ie
> > modems have baud and network cards have speed and video cards have ram. He
> > simply just has a 'products' table from which he extends
> > 'networkcard_products', etc. with the additional fields. Easy.
>
> And what's the problem with networkcard_products being a separate table
> that shares a key with the products table?
>
> CREATE TABLE products (product_id int, ...)
> CREATE TABLE networkcard_products_data (product_id int, ...)
> CREATE VIEW networkcard_products AS
> SELECT products.product_id, ...
> FROM products
> JOINT networkcard_products_data USING (product_id)
>
> What functionality does table inheritance offer that this traditional
> relational method of doing things doesn't?
You can add children without modifying your code. It is classic C++
inheritance; parent table accesses work with the new child tables
automatically.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2002-07-31 03:12:51 | Remove LockMethodTable.prio |
Previous Message | Curt Sampson | 2002-07-31 03:03:56 | Re: Why is MySQL more chosen over PostgreSQL? |