Re: Is it bug ?

From: "Ivar" <ivar(at)lumisoft(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Is it bug ?
Date: 2003-06-18 17:37:32
Message-ID: bcq80p$5hk$1@main.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)us> wrote in message
news:170(dot)1055956685(at)sss(dot)pgh(dot)pa(dot)us(dot)(dot)(dot)
> "Ivar" <ivar(at)lumisoft(dot)ee> writes:
> > "Jan Wieck" <JanWieck(at)Yahoo(dot)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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-06-18 17:39:49 Re: Linux supports hot-swappable hardware? [was Re:
Previous Message matt 2003-06-18 17:36:44 Re: PostgreSQL calibration