From: Richard Huxton <dev@archonet.com>
To: Sharmad Naik <sharmad@im.eth.net>
To: PGSQL-SQL <pgsql-sql@postgresql.org>
Subject: Re: primary key and indexing
Date: Fri, 19 Jan 2001 12:41:21 -0000
Message-ID: <006401c08215$21eedc00$1001a8c0@archonet.com> (raw)
References: <001201c081f9$87ebef00$1a090b3d@SharmadNaik>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, sharmad@im.eth.net
Subject: Re: primary key and indexing
In-Reply-To: <006401c08215$21eedc00$1001a8c0@archonet.com>
References: <001201c081f9$87ebef00$1a090b3d@SharmadNaik> <006401c08215$21eedc00$1001a8c0@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox