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

From Ivar
Subject Re: Is it bug ?
Date
Msg-id bcq80p$5hk$1@main.gmane.org
Whole thread Raw
In response to Is it bug ?  ("Ivar" <ivar@lumisoft.ee>)
List pgsql-general
May be its wiser to add additional(may be more than 1) _ between table and
column.

This solves problem.

(For current problem it works, see if I'm missing somethig)


CREATE TABLE m_tvh (
 web_teid varchar(40) UNIQUE
);

CREATE TABLE m_tvh_web (
 teid varchar(40) UNIQUE
);

Both wany make index with name 'm_tvh_web_teid_key'.

new results will be:
1) m_tvh__web_teid
2) m_tvh_web__teid



"Tom Lane" <tgl@sss.pgh.pa.us> wrote in message
news:170.1055956685@sss.pgh.pa.us...
> "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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>



pgsql-general by date:

Previous
From: "Ivar"
Date:
Subject: Is there any way to make post to newsgroups faster ?
Next
From: Yusuf
Date:
Subject: Performance differences using varchar, char and text