Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
pgSQL上带括号的错误_Sql_Postgresql - Fatal编程技术网

pgSQL上带括号的错误

pgSQL上带括号的错误,sql,postgresql,Sql,Postgresql,使用phpPgAdmin,我尝试在数据库中创建一个表。但是在生成代码后,我得到了一个错误 SQL错误: ERROR: syntax error at or near "(" at character 91 CREATE TABLE "public"."main_products_common_dimensions" ("id" SERIAL, "product_id" integer(3) NOT NULL, "h_ft" character varying(15), "h_in" char

使用phpPgAdmin,我尝试在数据库中创建一个表。但是在生成代码后,我得到了一个错误

SQL错误:

ERROR:  syntax error at or near "(" at character 91

CREATE TABLE "public"."main_products_common_dimensions" ("id" SERIAL, "product_id" integer(3) NOT NULL, "h_ft" character varying(15), "h_in" character varying(15), "w_ft" character varying(15), PRIMARY KEY ("id")) WITHOUT OIDS

括号可能有什么问题?

没有
整数(3)
:postgresql
整数
始终是4个字节,带符号。

没有
整数(3)
:postgresql
整数
始终是4个字节,带符号。

问题-您无法为
整数
类型指定精度,因此
整数(3)
是无效类型。使用
numeric(3)
或simple
integer
解决问题-您无法为
integer
类型指定精度,因此
integer(3)
是无效类型。使用
numeric(3)
或simple
integer

我的建议-使用PostgreSQL原生PgAdmin或psql。我的建议是使用PostgreSQL原生PgAdmin或psql。实际上,甚至连MySQL都没有
int(3)
“数据类型”。MySQL中的
int(4)
int
int(16)
是一样的。实际上,甚至MySQL都没有
int(3)
“数据类型”。MySQL中的
int(4)
int
int(16)
是一样的。