From: | "Tommy Cheng" <csckcac(at)gmail(dot)com> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: turn off auto index for foreign key |
Date: | 2008-06-10 05:16:55 |
Message-ID: | 2267dd9e0806092216n1dabf29ai6e7b82a727eaf5c5@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
um...Your soln is possible. But if the user created an unique index using
constraint name <table_name>_<column_name>_key5, it will not be able to
distinguish it from other auto index.
On Tue, Jun 10, 2008 at 12:58 PM, Alex Hunsaker <badalex(at)gmail(dot)com> wrote:
> On Mon, Jun 9, 2008 at 10:17 PM, Tommy Cheng <csckcac(at)gmail(dot)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)
>
From | Date | Subject | |
---|---|---|---|
Next Message | Zvi Fer | 2008-06-10 07:22:35 | Re: Postgres security issue - protecting datafiles |
Previous Message | Alex Hunsaker | 2008-06-10 04:58:15 | Re: turn off auto index for foreign key |