Re: primary key and indexing

From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "Sharmad Naik" <sharmad(at)im(dot)eth(dot)net>, "PGSQL-SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: primary key and indexing
Date: 2001-01-19 12:41:21
Message-ID: 006401c08215$21eedc00$1001a8c0@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Sorry for lack of proper quoting, you might find it useful to

From: "Sharmad Naik" <sharmad(at)im(dot)eth(dot)net>

I m sorry If anyone has already asked this Q earlier
I wanted to know

Q1. Whether I can have another key on which the table is indexed even though
i have a primary key..Then how would the data be accessed according to
primary key or the indexed key of my choice or i can index as per my choice
( primary / index key)?

You can create as many indices as you like. Type "\h create index" in psql
for details, but basically:

CREATE INDEX indexname ON table (columnlist)

PostgreSQL will use whichever index it thinks is the most useful. Remember
to vacuum analyze to update table statistics.

Q2. If possible can anybody tell me how to get the script given in the
e-book of Postresql be interpreted in Perl i.e
perl <name of file>
gives an error that Pg is not connected to Dbase

Don't know the script you're talking about. Check the settings in the
connect command. Try "perldoc Pg" for information on how the Pg module
works.

- Richard Huxton

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tomas Berndtsson 2001-01-19 12:56:34 Re: Trouble with subqueries
Previous Message Aleksey V. Kurinov 2001-01-19 12:23:31 SELECT FROM SELECT