我是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;
答案 0 :(得分:2)
没有integer(...)
类型,请在此处给出范围,选择smallint
,integer
或bigint
:
http://www.postgresql.org/docs/current/interactive/datatype-numeric.html
答案 1 :(得分:0)