Re: Is it bug ? - Mailing list pgsql-general

From Tom Lane
Subject Re: Is it bug ?
Date
Msg-id 170.1055956685@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is it bug ?  ("Ivar" <ivar@lumisoft.ee>)
Responses Re: Is it bug ?  (Dennis Gearon <gearond@cvc.net>)
List pgsql-general
"Ivar" <ivar@lumisoft.ee> writes:
> "Jan Wieck" <JanWieck@Yahoo.com> wrote
>> We maybe should relocate auto-created indexes for UNIQUE and PKEY
>> definitions into some sort of special schema and give them funny names?

> MS SQL adds funny names as columnName_236321_215251_156, seems that adds
> some random at end to avoid similar errors.

I think it's good that the index name is predictable.  I think we should
stick to the existing behavior as much as we can.

It would probably make sense to check if the generated name is actually
unused, and to stick some digits on the end if not.  For example, try
        tab_col_key
        tab_col_key1
        tab_col_key2
etc. until we find an unused name.  Of course this is still subject to
race conditions, but I think in practice it will solve the problem.

            regards, tom lane

pgsql-general by date:

Previous
From: Sven Köhler
Date:
Subject: Re: RE : full featured alter table?
Next
From: "Matthew Nuzum"
Date:
Subject: Re: PostgreSQL alternative to "Oracle Real Application Cluster"