Re: [HACKERS] Adding PRIMARY KEY info

From: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
To: vadim(at)krs(dot)ru (Vadim Mikheev)
Cc: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart), hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Adding PRIMARY KEY info
Date: 1998-09-03 14:56:43
Message-ID: m0zEaoV-00006JC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thus spake Vadim Mikheev
> Imho, indices should be used/created for FOREIGN keys and so pg_index
> is good place for both PRIMARY and FOREIGN keys infos.

Are you sure? I don't know about implementing it but it seems more
like an attribute thing rather than an index thing. Certainly from a
database design viewpoint you want to refer to the fields, not the
index on them. If you put it into the index then you have to do
an extra join to get the information.

Perhaps you have to do the extra join anyway for other purposes so it
may not matter. All I want is to be able to be able to extract the
field that the designer specified as the key. As long as I can design
a select statement that gives me that I don't much care how it is
implemented. I'll cache the information anyway so it won't have a
huge impact on my programs.

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-09-03 15:06:43 Re: [HACKERS] index fix report
Previous Message D'Arcy J.M. Cain 1998-09-03 14:46:55 Re: [HACKERS] Adding PRIMARY KEY info