X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 50B9A564CD for ; Wed, 16 Mar 2005 15:56:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 25687-08 for ; Wed, 16 Mar 2005 15:56:33 +0000 (GMT) Received: from resmta04.ono.com (smtp.ono.com [62.42.230.12]) by svr1.postgresql.org (Postfix) with ESMTP id E6B6356471 for ; Wed, 16 Mar 2005 15:56:30 +0000 (GMT) Received: from [80.58.11.235] by resmta04.ono.com with HTTP; Wed, 16 Mar 2005 16:56:33 +0100 Date: Wed, 16 Mar 2005 16:56:33 +0100 Message-ID: <422CFD5E0000774A@resmta04.ono.com> From: juanmime@ono.com Subject: A simple question To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.49 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, NO_REAL_NAME X-Spam-Level: * X-Archive-Number: 200503/246 X-Sequence-Number: 16744 Hello, I wonder if postgres autocreates an index on foreign or primary key field= s. For example: create table t1 ( f1 integer, f2 varchar, primary key (f1)); create table t2 ( f1 integer, f2 integer, primary key (f1), foreign key (f2) references t1(f1) ); In this sample, "t1" has a primary key, and "t2" both (primary and foreig= n keys). Does postgres create each indexes for the primary key of "t1" and "t2" ? and indexes for "f2" field in "t2" ? I expleain, there are several DBMS where autocreates these indexes for yo= u, and others that shows you an alert, for example, if you don't create an u= nique index for the primary key. Thanks.