turn off auto index for foreign key

turn off auto index for foreign key

am 10.06.2008 04:48:08 von Tommy Cheng

------=_Part_1176_17570322.1213066088653
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi admins,
I would like to turn off the auto index for child table's foreign key. It
is because i want to read the information_schema for table, column, index,
unique and so on after creating the database. How to turn off the auto
behavior? Or Is there a way to distinguish between auto one and user created
index?
Thanks
Tommy Cheng

------=_Part_1176_17570322.1213066088653
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi admins,
  I would like to turn off the auto index for child table's foreign key. It is because i want to read the information_schema for table, column, index, unique and so on after creating the database. How to turn off the auto behavior? Or Is there a way to distinguish between auto one and user created index?

  Thanks
Tommy Cheng


------=_Part_1176_17570322.1213066088653--

Re: turn off auto index for foreign key

am 10.06.2008 05:50:03 von Scott Marlowe

On Mon, Jun 9, 2008 at 8:48 PM, Tommy Cheng wrote:
> Hi admins,
> I would like to turn off the auto index for child table's foreign key. It
> is because i want to read the information_schema for table, column, index,
> unique and so on after creating the database. How to turn off the auto
> behavior? Or Is there a way to distinguish between auto one and user created
> index?

There is no auto index creation for child relationships, only for the
parent (unique index for primary key etc)

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: turn off auto index for foreign key

am 10.06.2008 06:17:24 von Tommy Cheng

------=_Part_1343_31016898.1213071444671
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

On Tue, Jun 10, 2008 at 11:50 AM, Scott Marlowe
wrote:

> On Mon, Jun 9, 2008 at 8:48 PM, Tommy Cheng wrote:
> > Hi admins,
> > I would like to turn off the auto index for child table's foreign key.
> It
> > is because i want to read the information_schema for table, column,
> index,
> > unique and so on after creating the database. How to turn off the auto
> > behavior? Or Is there a way to distinguish between auto one and user
> created
> > index?
>
> There is no auto index creation for child relationships, only for the
> parent (unique index for primary key etc)
>

------=_Part_1343_31016898.1213071444671
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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


On Tue, Jun 10, 2008 at 11:50 AM, Scott Marlowe <> wrote:

On Mon, Jun 9, 2008 at 8:48 PM, Tommy Cheng <> wrote:

> Hi admins,

>   I would like to turn off the auto index for child table's foreign key. It

> is because i want to read the information_schema for table, column, index,

> unique and so on after creating the database. How to turn off the auto

> behavior? Or Is there a way to distinguish between auto one and user created

> index?



There is no auto index creation for child relationships, only for the

parent (unique index for primary key etc)




------=_Part_1343_31016898.1213071444671--

Re: turn off auto index for foreign key

am 10.06.2008 06:58:15 von Alex Hunsaker

On Mon, Jun 9, 2008 at 10:17 PM, Tommy Cheng 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: _pkey(num)
unique: __key(num)

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: turn off auto index for foreign key

am 10.06.2008 07:16:55 von Tommy Cheng

------=_Part_1460_32987678.1213075015366
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

um...Your soln is possible. But if the user created an unique index using
constraint 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 wrote:

> On Mon, Jun 9, 2008 at 10:17 PM, Tommy Cheng 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: _pkey(num)
> unique: __key(num)
>

------=_Part_1460_32987678.1213075015366
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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 <> wrote:

On Mon, Jun 9, 2008 at 10:17 PM, Tommy Cheng <> 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

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)




------=_Part_1460_32987678.1213075015366--