Re: primary key and indexing - Mailing list pgsql-sql

From Richard Huxton
Subject Re: primary key and indexing
Date
Msg-id 006401c08215$21eedc00$1001a8c0@archonet.com
Whole thread Raw
In response to primary key and indexing  ("Sharmad Naik" <sharmad@im.eth.net>)
List pgsql-sql
Sorry for lack of proper quoting, you might find it useful to

From: "Sharmad Naik" <sharmad@im.eth.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



pgsql-sql by date:

Previous
From: Yury Don
Date:
Subject: Re: Trouble with subqueries
Next
From: Kovacs Zoltan Sandor
Date:
Subject: Re: notice on transaction abort?