Re: duplicate key ? (fwd)

From: KuroiNeko <evpopkov(at)carrier(dot)kiev(dot)ua>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: duplicate key ? (fwd)
Date: 2000-10-21 04:46:52
Message-ID: 39F11FBC.nailDN114K4D@ed.ed
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Fo2Me=# drop table dirinfo;
> DROP
> Fo2Me=# CREATE TABLE dirinfo(
> Fo2Me(# code VARCHAR(8) PRIMARY KEY,
> Fo2Me(# level SMALLINT NOT NULL,
> Fo2Me(# name TEXT NOT NULL,
> Fo2Me(# count SMALLINT NOT NULL DEFAULT 0
> Fo2Me(# );
> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index
> 'dirinfo_pkey'
> for table 'dirinfo'
> CREATE
> Fo2Me=# INSERT INTO dirinfo (code, level, name) VALUES('hbcol', 1,
> 'abc');
> INSERT 63411 1
> Fo2Me=# INSERT INTO dirinfo (code, level, name) VALUES('hbcrf', 1,
> 'zzz');
> ERROR: Cannot insert a duplicate key into unique index dirinfo_pkey
>
> The version of postgresql is 7.0.2 and the database created with EUC_KR
>encoding.

And that's strange. I'm not sure about encodings, never used them....
Probably you should use another datatype to textual attributes? It's very
likely that when you're trying to enter 'hbcol', an escape sequence is
entered (2 bytes), and then each ASCII char also takes two octets.
Hmmmm.... So, it's truncated? If so, then with the first insert only escape
sequence and 'hbc' is inserted and this causes duplication for the second
insert?
Just a wild speculation. Someone with more experience would be more
helpfull.

--

contaminated fish and microchips
huge supertankers on Arabian trips
oily propaganda from the leaders' lips
all about the future
there's people over here, people over there
everybody's looking for a little more air
crossing all the borders just to take their share
planning for the future

Rainbow, Difficult to Cure

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sungchul Park 2000-10-21 05:34:18 Re: duplicate key ? (fwd)
Previous Message Sungchul Park 2000-10-21 04:25:58 duplicate key ? (fwd)