对于postgres中的类型字符变化(200),值太长

时间:2012-03-06 12:26:56

标签: sql postgresql django-models

我正在为我的项目使用django模型当我点击我的查询以插入行时。我收到错误

查询:

 INSERT INTO "intelligence_centre_organicsearchresults" 
 ("keyword", "location", "position", "page_no", "headline", "url", "exerpt", "query_url", "content_updated_date", "created_on", "modified_on", "downloaded") 
 VALUES 
 (E'abilify', NULL, 8, 1, E'NAMI | Abilify (aripiprazole)', E'/url?q=http://www.nami.org/Template.cfm?Section=About_Medications&template=/ContentManagement/ContentDisplay.cfm&ContentID=8133&sa=U&ei=-v5VT7HkHMTsrAf5wqCLBw&ved=0CEEQFjAH&usg=AFQjCNG7-G-LSrWE65DeZuDmy2Uvi71HTg', E'What is the most important information I should know about Abilify®? Relapse is very common in schizophrenia and the most frequent cause is that patients stop ...www.nami.org/Template.cfm?Section=About_Medications... - Cached - Similar', NULL, NULL, E'2012-03-06 06:11:37.606388', E'2012-03-06 06:11:37.606449', true)

错误:

   ERROR:  value too long for type character varying(200)

我的架构字段大小也针对此问题进行了扩展:

  ALTER TABLE intelligence_centre_adwordsearchresults
ALTER COLUMN landing_page_url TYPE character varying(1000)

同样我扩大了所有领域的规模。

我已将表格描述附加为屏幕截图。

enter image description here

请建议我解决此错误?

2 个答案:

答案 0 :(得分:2)

插入intelligence_centre_ORGANICsearchresults时收到错误,但您更改了intelligence_centre_ADWORDsearchresult上的列。我认为您需要更改intelligence_centre_ORGANICsearchresults上的列。

答案 1 :(得分:1)

首先检查表名。如果你看到表名,你的解决方案就没问题了。