Re: duplicate key ? (fwd)
От | KuroiNeko |
---|---|
Тема | Re: duplicate key ? (fwd) |
Дата | |
Msg-id | 39F11FBC.nailDN114K4D@ed.ed обсуждение исходный текст |
Ответ на | duplicate key ? (fwd) (Sungchul Park <scpark@gen128.com>) |
Ответы |
Re: duplicate key ? (fwd)
|
Список | 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
В списке pgsql-general по дате отправления: