Received: from fileserver002.intecsystems.co.uk ([194.200.14.125]) by hub.org (8.10.1/8.10.1) with ESMTP id e93Epir93219 for ; Tue, 3 Oct 2000 10:51:45 -0400 (EDT) Received: by fileserver002.intecsystems.co.uk with Internet Mail Service (5.5.2650.21) id <4D5C9A69>; Tue, 3 Oct 2000 15:52:50 +0100 Message-ID: <7F124BC48D56D411812500D0B747251406144E@fileserver002.intecsystems.co.uk> From: Michael Ansley To: "'Kenn Thompson'" Cc: "'pgsql-sql@postgresql.org'" Subject: RE: Object features of pg Date: Tue, 3 Oct 2000 15:52:50 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C02D49.9A11B28C" X-Archive-Number: 200010/26 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C02D49.9A11B28C Content-Type: text/plain; charset="iso-8859-1" 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 >> 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 >> >> 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 >> >> >> >> >> ------_=_NextPart_001_01C02D49.9A11B28C Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: [SQL] Object features of pg

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 d= on't understand the
>>   advantage of having a type address.= Especially when you
>>   seem to be using standard SQL to ma= nipulate the data anyway.
I'm not sure how postgres does it, but I think that it m= ight actually store the address in the address table, and use an oid to ref= erence 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 s= hould be a LOT faster than using a foreign key lookup.  My understandi= ng 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 c= lient, but that would only really be going half the distance.

That's the plan, anyway.

Cheers...



>>  
>>   >>> Michael Ansley
>>   <Michael.Ansley@intec-telecom-sy= stems.com> 10/03/00 09:25AM >>>
>>   No.  I want the address attrib= ute of the client class to
>>   be of type address,
>>   which is defined by the address tab= le.  Perhaps I should
>>   have named things a
>>   little more clearly ;-)
>>  
>>  
>>   >>   -----Original = Message-----
>>   >>   From: Kenn Tho= mpson [mailto:KThompson@adesta= group.com]
>>   >>   Sent: 03 Octob= er 2000 15:15
>>   >>   To: Michael.An= sley@intec-telecom-systems.com
>>   >>   Subject: Re: [= SQL] Object features of pg
>>   >>  
>>   >>  
>>   >>   Shouldn't that= be
>>   >>   create table a= ddress (address varchar(50), postcode
>>   varchar(9));
>>   >>   create table c= lient(id integer, name varchar(30), address
>>   >>   varchar(50);
>>   >>   ?
>>   >>  
>>   >>   >>> M= ichael Ansley
>>   >>   <Michael.An= sley@intec-telecom-systems.com> 10/03/00
>>   08:14AM >>>
>>   >>   I've done the = following:
>>   >>  
>>   >>   create table a= ddress (address varchar(50), postcode
>>   varchar(9));
>>   >>   create table c= lient(id integer, name varchar(30),
>>   address address);
>>   >>  
>>   >>   Now, how the h= ell do I get information into the address
>>   >>   field of clien= t?
>>   >>   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 grate= fully accepted.
>>   >>  
>>   >>   Cheers...
>>   >>  
>>   >>   MikeA
>>   >>  
>>   >>  
>>  

------_=_NextPart_001_01C02D49.9A11B28C--