Inheritance

From: anil <anil(at)server(dot)awcoldstream(dot)com>
To: "pgsql-sql(at)postgreSQL(dot)org" <pgsql-sql(at)postgreSQL(dot)org>
Subject: Inheritance
Date: 1998-11-21 06:21:46
Message-ID: 36565BF9.10873260@awcoldstream.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi All,

I have a fields for customer:

cusId int4 - customer ID Unique number
cusName text - Customer Name
cusPrice int4 - Customer pricing scheme
cusAdd text - Customer Address
cusCity text - customer city
cusProv text - Customer city
cusZip text - Customer zip

I am using first three fields on a order window lot and I use all fields

on the customer information Window.
if i create two tables::
table scustomer -> (cusid int4 primary key, cusName text, cus
cusPrice)

lcustomer -> (cusAdd text , cusCity text, cusProv text
,cusZip text ) inherits (scustomer)

so I could use

select cusId,cusName,cusPrice from lcustomer;
or
select * from from scustomer*;

which query is going to faser???? or is there anyway that I insert some
rows into lcustomer table and get result on corrosponding fields on
scustomer table??

I have tried this:
insert into lcustomer(1234,'My
customer',10,'Myaddress',Mycity','Myprov','Myzip');

select * from lcustomer;
1234 | My customer | 10 | Myaddress | Mycity
| Myprov | Myzip

select * from scustomer;
zero rows;

select * from scustomer*;
1234 | My customer | 10

what do you mean by - Append (cost=0.0 size=0 width=0) on the out put of
explain select * from scustomer*;

Thank you

Anil

Browse pgsql-sql by date

  From Date Subject
Next Message sqyang 1998-11-21 08:02:15 optimization
Previous Message Bob Smither 1998-11-21 00:44:48 Re: [SQL] abs value, power, sqrt