Thread
-
Re: Antw: many-many mapping between unique tables
Gerhard Dieringer <dieringg@eba-haus.de> — 2000-10-16T08:09:50Z
>>> Indraneel Majumdar <indraneel@www.cdfd.org.in> 16.10.2000 22.13 Uhr >>> > Yeah you understand the problem perfectly. The third table will definitely > contain unique entries if you take both x and y simultaneously. I wanted > some way of mapping where I would not need to repeat individual values of > x and y. I am not from a maths background and have absolutely no idea of > database design. > > Is it possible to map the columns without repeating values? > > \Indraneel I don't know what type of data your columns x and y contain. If they are, for example, of type text and contain long strings, then it would be better to add an integer id column in each tables T1 and T2: x_id and y_id and use these ids in the table T12. Then you only have to repeat the (short) numeric vales in T12. But I think there is no way to totaly avoid any repetition. -------------- Gerhard
-
Re: Antw: many-many mapping between unique tables
Josh Berkus <josh@agliodbs.com> — 2000-10-16T15:17:40Z
Mr. Majumdar, > > Sorry for splitting mails. Is there some way of using the oid of each > row to do the mapping instead of creating two more columns of integers? > The third table can then be like this: > > create table T3( > T1 oid, > T2 oid > ); Please reference two things: 1. Look in the list archives for the last 4 weeks and you will read a long discussion on the risks/limitations of using an OID as the primary key on very large tables. (Subject: Object-Relational Database Design). 2. For how to use OIDs, please look in Bruce Momjian's excellent PGSQL book-in-progress, available on the Postgresql.org website. (Chapter 7, I believe). -Josh Berkus -- ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 436-9166 for law firms, small businesses fax 436-0137 and non-profit organizations. pager 338-4078 San Francisco -
Re: Antw: many-many mapping between unique tables
Indraneel Majumdar <indraneel@www.cdfd.org.in> — 2000-10-16T21:54:47Z
Sorry for splitting mails. Is there some way of using the oid of each row to do the mapping instead of creating two more columns of integers? The third table can then be like this: create table T3( T1 oid, T2 oid ); also how can I find out the oid of a particular row? and how can I use this oid in a select statement? Thanks, Indraneel On Mon, 16 Oct 2000, Gerhard Dieringer wrote: > I don't know what type of data your columns x and y contain. If they are, > for example, of type text and contain long strings, then it would be better > to add an integer id column in each tables T1 and T2: x_id and y_id and > use these ids in the table T12. > > Then you only have to repeat the (short) numeric vales in T12. But I think there > is no way to totaly avoid any repetition. > > -------------- > Gerhard > /************************************************************************. # Indraneel Majumdar ¡ E-mail: indraneel@123india.com # # Bioinformatics Unit (EMBNET node), ¡ URL: http://scorpius.iwarp.com # # Centre for DNA Fingerprinting and Diagnostics, # # Hyderabad, India - 500076 # `************************************************************************/
-
Re: Antw: many-many mapping between unique tables
Indraneel Majumdar <indraneel@www.cdfd.org.in> — 2000-10-17T05:19:43Z
Hi, Thank you very much. Now I know to use serial and not oid. I hope I got the correct message. Thanks, Indraneel On Mon, 16 Oct 2000, Josh Berkus wrote: > Please reference two things: > > 1. Look in the list archives for the last 4 weeks and you will read a > long discussion on the risks/limitations of using an OID as the primary > key on very large tables. (Subject: Object-Relational Database Design). > > 2. For how to use OIDs, please look in Bruce Momjian's excellent PGSQL > book-in-progress, available on the Postgresql.org website. (Chapter 7, I > believe). > /************************************************************************. # Indraneel Majumdar ¡ E-mail: indraneel@123india.com # # Bioinformatics Unit (EMBNET node), ¡ URL: http://scorpius.iwarp.com # # Centre for DNA Fingerprinting and Diagnostics, # # Hyderabad, India - 500076 # `************************************************************************/