2
我有PostgreSQL的如下表:如何截斷列以創建索引?
database=# \d dic
Table "public.dic"
Column | Type | Modifiers
-------------+-------------------------+-----------
id | bigint |
stringvalue | character varying(2712) |
database=# create index idStringvalue on dic(id,stringvalue);
ERROR: index row size 2728 exceeds maximum 2712 for index "idstringvalue"
HINT: Values larger than 1/3 of a buffer page cannot be indexed.
Consider a function index of an MD5 hash of the value, or use full text indexing.
我不知道爲什麼是錯誤快到時stringValue的規模是2712
我想截斷在DIC所有stringValue的公司造成的以上錯誤。但是,我不知道如何去做。有人可以幫助我嗎?
我很好,刪除導致此錯誤的行。我可以這樣做嗎?
[與dba.SE相關的答案](http://dba.stackexchange.com/questions/25138/index-max-row-size-error/25140#25140)也可能有幫助。 –