gpt4 book ai didi

postgresql - 错误 : syntax error at or near "(" when creating a new table

转载 作者:行者123 更新时间:2023-12-02 04:37:16 24 4
gpt4 key购买 nike

我对 PostgreSQL 非常陌生,每次尝试创建新表时,我都会遇到以下错误:

ERROR:  syntax error at or near "(" LINE 1: ..." ("id_azucarusuario" 
SERIAL, "id_usuario" integer(128) NOT ...

这是我要定义的表的 SQL:

CREATE TABLE "public"."usuario_azucar" 
( "id_azucarusuario" SERIAL,
"id_usuario" integer(128) NOT NULL,
"codigogeneral" character varying(240) NOT NULL,
"razonsocial" character(240),
"nombrecomercial" character(240),
"nit" integer(128),
"nummatricula" integer(128),
"direccionempresa" character(240),
"subdepartamento" character(240),
"subciudad" character(240),
"subdireccion" character varying(240),
"subcalle" character varying(240),
"subreferencia" character varying(240),
"subtelefono" integer(128),
"subpagweb" character(240),
"subemail" character varying(240),
"rai" character varying(240),
"descripcion_proceso_azucar" character varying(240),
"descripcion_proceso_alcohol" character varying(240),
"balance_energeticoomasic" character varying(240),
"productos_obtenidos" character varying(240),
"capacidad_azuoalco" character varying(240),
"capacidadreal_azuoalcoho" character varying(240),
PRIMARY KEY ("id_azucarusuario")
)
WITHOUT OIDS;

最佳答案

没有integer(...)类型,选择smallintintegerbigint给定这里的范围: http://www.postgresql.org/docs/current/interactive/datatype-numeric.html

关于postgresql - 错误 : syntax error at or near "(" when creating a new table,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21716853/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com