While trying to generate a table in PGadmin, I'm getting the following error:
ERROR: syntax error at or near ","
LINE 3: "ID" integer NOT NULL DEFAULT,
^
Why doesn't it like the comma? This is the sql generated by PGadmin, it's strange it does not like it's own sql.
CREATE TABLE public.email_list
(
"ID" integer NOT NULL DEFAULT,
"FIRST NAME" "char",
"LAST NAME" "char",
"EMAIL" "char",
"TITLE" "char",
"LOCATION" "char",
"COMPANY WEBSITE" "char",
"COMPANY TYPE" numeric,
"DATE ADDED" timestamp with time zone,
"LAST CONTACT DATE" date,
"STATUS CODE" "char",
CONSTRAINT "ID" PRIMARY KEY ("ID")
)
TABLESPACE pg_default;
ALTER TABLE public.email_lists
OWNER to postgres;
When first look at your query i saw something look not fit, here i show how I fixed it.
CREATE TABLE public.email_list
(
"ID" integer NOT NULL DEFAULT, <<-- You have to set DEFAULT follow with some value e.g : DEFAULT 0, or u can remove the DEFAULT keyword instead.
"FIRST NAME" "char",
"LAST NAME" "char",
"EMAIL" "char",
"TITLE" "char",
"LOCATION" "char",
"COMPANY WEBSITE" "char",
"COMPANY TYPE" numeric,
"DATE ADDED" timestamp with time zone,
"LAST CONTACT DATE" date,
"STATUS CODE" "char",
CONSTRAINT "ID" PRIMARY KEY ("ID")
)
Hope this can help solve the problem.