pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Ansley <Michael.Ansley@intec-telecom-systems.com>
To: 'Kenn Thompson' <KThompson@adestagroup.com>
Cc: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: RE: Object features of pg
Date: Tue, 3 Oct 2000 15:52:50 +0100
Message-ID: <7F124BC48D56D411812500D0B747251406144E@fileserver002.intecsystems.co.uk> (raw)

Hi, Kenn,

>>   It seems that if you want to define a type address that 
>>   you will need more than a reference in another table. I 
>>   see what you're trying to do, but don't understand the 
>>   advantage of having a type address. Especially when you 
>>   seem to be using standard SQL to manipulate the data anyway.
I'm not sure how postgres does it, but I think that it might actually store
the address in the address table, and use an oid to reference it from the
client table.  The reason for doing this is that a) it matches the way an
object orientated language would map it, and b) it should be a LOT faster
than using a foreign key lookup.  My understanding is that using OIDs is way
faster than using FKs, which is where ODBs get their speed from.  So, if I
can do objects like ODBs in postgres then I get the speed of an ODB with the
funcionality of a relational database (functions, sql, rules, etc.)
Of course, I could just use the address OID as an FK on client, but that
would only really be going half the distance.

That's the plan, anyway.

Cheers...



>>   
>>   >>> Michael Ansley 
>>   <Michael.Ansley@intec-telecom-systems.com> 10/03/00 09:25AM >>>
>>   No.  I want the address attribute of the client class to 
>>   be of type address,
>>   which is defined by the address table.  Perhaps I should 
>>   have named things a
>>   little more clearly ;-)
>>   
>>   
>>   >>   -----Original Message-----
>>   >>   From: Kenn Thompson [mailto:KThompson@adestagroup.com] 
>>   >>   Sent: 03 October 2000 15:15
>>   >>   To: Michael.Ansley@intec-telecom-systems.com 
>>   >>   Subject: Re: [SQL] Object features of pg
>>   >>   
>>   >>   
>>   >>   Shouldn't that be 
>>   >>   create table address (address varchar(50), postcode 
>>   varchar(9));
>>   >>   create table client(id integer, name varchar(30), address 
>>   >>   varchar(50);
>>   >>   ?
>>   >>   
>>   >>   >>> Michael Ansley 
>>   >>   <Michael.Ansley@intec-telecom-systems.com> 10/03/00 
>>   08:14AM >>>
>>   >>   I've done the following:
>>   >>   
>>   >>   create table address (address varchar(50), postcode 
>>   varchar(9));
>>   >>   create table client(id integer, name varchar(30), 
>>   address address);
>>   >>   
>>   >>   Now, how the hell do I get information into the address 
>>   >>   field of client?
>>   >>   There appears to be very little in the manual dealing with 
>>   >>   PGs object
>>   >>   features.  Any pointers to places in the manual, or direct 
>>   >>   instructions
>>   >>   would be gratefully accepted.
>>   >>   
>>   >>   Cheers...
>>   >>   
>>   >>   MikeA
>>   >>   
>>   >>   
>>   

view thread (8+ messages)  latest in thread

Message-ID: <7F124BC48D56D411812500D0B747251406144E@fileserver002.intecsystems.co.uk>
Permalink:  ../7F124BC48D56D411812500D0B747251406144E@fileserver002.intecsystems.co.uk/
Also on:    postgresql.org/message-id/7F124BC48D56D411812500D0B747251406144E@fileserver002.intecsystems.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: Michael.Ansley@intec-telecom-systems.com, KThompson@adestagroup.com
  Subject: Re: Object features of pg
  In-Reply-To: <7F124BC48D56D411812500D0B747251406144E@fileserver002.intecsystems.co.uk>
  References: <7F124BC48D56D411812500D0B747251406144E@fileserver002.intecsystems.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox