Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Minor bug: inconsistent handling of overlength names

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Minor bug: inconsistent handling of overlength names
Date: 1998-08-29 02:36:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
> DROP INDEX fails on overlength table names:
> tgl=> CREATE UNIQUE INDEX MarketOrderHistory_sequenceNo_Index
> tgl-> ON MarketOrderHistory USING btree (sequenceNo);
> tgl=> DROP INDEX MarketOrderHistory_sequenceNo_Index;
> ERROR:  pg_ownercheck: class "marketorderhistory_sequenceno_index" not found
> tgl=> DROP INDEX MarketOrderHistory_sequenceNo_I;
> Evidently DROP INDEX is using a second-rate way of reducing the given
> name to canonical form for comparisons.
> Some further experimentation shows that CREATE TABLE won't let you
> create a relation name >= 32 characters in the first place.  So there's
> some inconsistency about what's done with overlength names.
> It seems to me that we ought to have consistent treatment of long names,
> and the treatment I like is the one that CREATE INDEX is using:
> silently truncate the given name to what we can handle, and accept
> it as long as the truncated form is unique.  This is the time-honored
> way of handling overlength names in compilers, and it works well.

OK. I have modified scan.l so it now truncates identifiers over
NAMEDATALEN, so this should fix it.

Bruce Momjian                          |  830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 1998-08-29 02:54:49
Subject: Re: [HACKERS] odd pg_dump output?
Previous:From: Bruce MomjianDate: 1998-08-29 02:17:54
Subject: Re: [HACKERS] Segmentation fault with lo_export

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group