phppgadmin, pkey's and indexes

Started by CSNover 22 years ago4 messagesgeneral
Jump to latest
#1CSN
cool_screen_name90001@yahoo.com

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/

#2Michael Fuhr
mike@fuhr.org
In reply to: CSN (#1)
Re: phppgadmin, pkey's and indexes

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/current/static/sql-createtable.html

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: CSN (#1)
Re: phppgadmin, pkey's and indexes

CSN <cool_screen_name90001@yahoo.com> writes:

Does creating a primary key
automatically create an index?

Yup.

regards, tom lane

#4CSN
cool_screen_name90001@yahoo.com
In reply to: Michael Fuhr (#2)
Re: phppgadmin, pkey's and indexes
--- 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/