Обсуждение: Sequence error ?

Поиск
Список
Период
Сортировка

Sequence error ?

От
Aarni Ruuhimäki
Дата:
Hi,

Trying to import data from a dump into 7.4.1

Here's the dump:

------snip-------
CREATE SEQUENCE "users_id_seq" start 1 increment 1 maxvalue
9223372036854775807 minvalue 1 cache 1;

--
-- TOC Entry ID 28 (OID 37618312)
--
-- Name: users Type: TABLE Owner: postgres
--

CREATE TABLE "users" (
    "id" integer DEFAULT nextval('"users_id_seq"'::text) NOT NULL,
    "username" character varying(15) NOT NULL,
    "password" character varying(15) NOT NULL,
    ...
    "is_newuser" boolean DEFAULT 't' NOT NULL,
    Constraint "users_pkey" Primary Key ("id")
------/snip-------


And here's the error:

------snip-------
CREATE SEQUENCE
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey"
for table "users"
ERROR:  invalid input syntax for integer: ""
------/snip-------


Data for the table:

------snip-------
-- Name: users Type: TABLE DATA Owner: postgres
--


INSERT INTO "users" VALUES (1,'xxxxxxxx','yyyyyyyy',0,'9999-12-12
00:00:00','2004-03-03
15:49:28.028026+02','xxxxxxxx','xxxxxxxxr','','','','','','','t',0,'t');
------/snip-------

All other sequences and tables are created just fine with no errors.

Anyone ?


Thanks and best regards,

Aarni



-------------------------------------------------
This is a bugfree broadcast to you from a linux system.

Re: Sequence error ?

От
Tom Lane
Дата:
Aarni =?iso-8859-1?q?Ruuhim=E4ki?= <aarni.ruuhimaki@kymi.com> writes:
> ERROR:  invalid input syntax for integer: ""
> [from]
> INSERT INTO "users" VALUES (1,'xxxxxxxx','yyyyyyyy',0,'9999-12-12
> 00:00:00','2004-03-03
> 15:49:28.028026+02','xxxxxxxx','xxxxxxxxr','','','','','','','t',0,'t');

You didn't show us all the column definitions, but are any of the ninth
through fourteenth columns integers?  That's certainly where I'd look on
the basis of this error ...

            regards, tom lane