From: juanmime@ono.com
To: pgsql-admin@postgresql.org
Subject: A simple question
Date: Wed, 16 Mar 2005 16:56:33 +0100
Message-ID: <422CFD5E0000774A@resmta04.ono.com> (raw)
Hello,
I wonder if postgres autocreates an index on foreign or primary key fields.
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 foreign
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 you,
and others that shows you an alert, for example, if you don't create an unique
index for the primary key.
Thanks.
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-admin@postgresql.org
Cc: juanmime@ono.com
Subject: Re: A simple question
In-Reply-To: <422CFD5E0000774A@resmta04.ono.com>
References: <422CFD5E0000774A@resmta04.ono.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