【问题标题】:value too long for type character varying(200) in postgrespostgres中类型字符变化(200)的值太长
【发布时间】:2012-03-23 22:20:57
【问题描述】:

我正在为我的项目使用 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)

同样,我扩展了所有字段的大小。

我已附上我的表格描述作为屏幕截图。

请建议我解决这个错误?

【问题讨论】:

  • 下次请将表定义发布为CREATE TABLE 语句。或者至少作为格式化文本,而不是作为屏幕截图

标签: sql postgresql django-models


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    首先检查表名。如果您看到表名,您的解决方案就可以了。

    【讨论】:

      猜你喜欢
      • 2021-04-03
      • 2019-10-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-06
      • 2020-04-04
      • 2012-10-02
      • 2012-02-20
      • 2020-01-18
      相关资源
      最近更新 更多