By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,934 Members | 1,685 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,934 IT Pros & Developers. It's quick & easy.

phppgadmin, pkey's and indexes

P: n/a
CSN
In phppgadmin, primary keys are added/shown under
"constraints". Does creating a primary key
automatically create an index? No indexes are listed
under phppgadmin's indexes page, but "\d table" in
psql shows indexes for primary keys.

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Sun, Dec 28, 2003 at 10:42:32PM -0800, CSN wrote:
In phppgadmin, primary keys are added/shown under
"constraints". Does creating a primary key
automatically create an index? No indexes are listed
under phppgadmin's indexes page, but "\d table" in
psql shows indexes for primary keys.


From the documentation for CREATE TABLE:

"PostgreSQL automatically creates an index for each unique constraint
and primary key constraint to enforce the uniqueness. Thus, it is not
necessary to create an explicit index for primary key columns."

http://www.postgresql.org/docs/curre...eatetable.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #2

P: n/a
CSN <co*******************@yahoo.com> writes:
Does creating a primary key
automatically create an index?


Yup.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #3

P: n/a
CSN

--- Tom Lane wrote:
Does creating a primary key
automatically create an index?
Yup.


BTREE's only?

CSN

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.