pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alex Hunsaker <badalex@gmail.com>
To: Tommy Cheng <csckcac@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: turn off auto index for foreign key
Date: Mon, 9 Jun 2008 22:58:15 -0600
Message-ID: <34d269d40806092158vc3069e7gfd58166dee46aa2c@mail.gmail.com> (raw)
In-Reply-To: <2267dd9e0806092117sda112dt8ac2f2ba8ed5e66f@mail.gmail.com>
References: <2267dd9e0806091948k24a46cegcd45e65a5aa632ed@mail.gmail.com>
	<dcc563d10806092050y3f41ef00j95390d335e4d11c0@mail.gmail.com>
	<2267dd9e0806092117sda112dt8ac2f2ba8ed5e66f@mail.gmail.com>

On Mon, Jun 9, 2008 at 10:17 PM, Tommy Cheng <csckcac@gmail.com> wrote:
> you are right. I double checked. So, is there any way to turn off auto index
> creation for the parent? (the best is changing postgresql database setting)
> I am using postgres (PostgreSQL) 8.1.9 on CentOS 5 x86_64
>

Again, there is no auto index creation for foriegn keys.  However if
you declared the column unique or its the pkey (ala unique) (As Scott
said) then there will  an index.

No you cant turn it off because its how postgres enforces uniqueness
see http://www.postgresql.org/docs/8.1/interactive/index-unique-checks.html
for more

My guess, use the name of the index to try to distinguish.  Auto
generated ones will always be in the form:
pkey: <table_name>_pkey(num)
unique: <table_name>_<column_name>_key(num)



view thread (5+ messages)  latest in thread

Message-ID: <34d269d40806092158vc3069e7gfd58166dee46aa2c@mail.gmail.com>
Permalink:  ../34d269d40806092158vc3069e7gfd58166dee46aa2c@mail.gmail.com/
Also on:    postgresql.org/message-id/34d269d40806092158vc3069e7gfd58166dee46aa2c@mail.gmail.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: badalex@gmail.com, csckcac@gmail.com
  Subject: Re: turn off auto index for foreign key
  In-Reply-To: <34d269d40806092158vc3069e7gfd58166dee46aa2c@mail.gmail.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