Re: Identifier gets truncated - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Identifier gets truncated
Date
Msg-id 20130110162334.GA24281@momjian.us
Whole thread Raw
In response to Identifier gets truncated  (Peter Kroon <plakroon@gmail.com>)
List pgsql-general
On Thu, Jan 10, 2013 at 03:36:32PM +0100, Peter Kroon wrote:
> When an identifier has more then 63 chars it gets truncated.
> This is fine.
> However PostgreSQL fails to notice that it might truncate to an identifier
> which already exist.
> Does PostgreSQL got a setting that will never create a duplicate identifier?
>
> really_long_name_table_A -> really_long_na
> really_long_name_table_B -> really_long_na

Well, if an indenfier truncates to a name that conflicts with another
one, you will get an error:

 test=> create table test(
 test(>
x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111int, 
 test(>
x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112int); 
 NOTICE:  identifier
"x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"will
betruncated to "x11111111111111111111111111111111111111111111111111111111111111" 
 NOTICE:  identifier
"x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112"will
betruncated to "x11111111111111111111111111111111111111111111111111111111111111" 
 ERROR:  column "x11111111111111111111111111111111111111111111111111111111111111" specified more than once

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


pgsql-general by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: When to run Vacuum in postgres 9.0.4
Next
From: "Kevin Grittner"
Date:
Subject: Re: When to run Vacuum in postgres 9.0.4