dbTalk Databases Forums  

Sequence error ?

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Sequence error ? in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Aarni Ruuhimäki
 
Posts: n/a

Default Sequence error ? - 05-25-2004 , 07:19 AM






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.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: Sequence error ? - 05-25-2004 , 09:44 AM






Aarni =?iso-8859-1?q?Ruuhim=E4ki?= <aarni.ruuhimaki (AT) kymi (DOT) com> writes:
Quote:
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

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
  #3  
Old   
Aarni Ruuhimäki
 
Posts: n/a

Default Fwd: Re: Sequence error ? - 05-25-2004 , 10:57 AM



Hi,

And thanks for the tip Tom.

There was a slight contradiction in this:

"country" integer DEFAULT '' NOT NULL,

Best regards,

Aarni

---------- Forwarded Message ----------

Subject: Re: [NOVICE] Sequence error ?
Date: Tue, 25 May 2004 10:44:51 -0400
From: Tom Lane <tgl (AT) sss (DOT) pgh.pa.us>
To: aarni.ruuhimaki (AT) kymi (DOT) com
Cc: pgsql-novice (AT) postgresql (DOT) org

Aarni =?iso-8859-1?q?Ruuhim=E4ki?= <aarni.ruuhimaki (AT) kymi (DOT) com> writes:
Quote:
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

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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
  #4  
Old   
Gaetano Mendola
 
Posts: n/a

Default Re: Fwd: Re: Sequence error ? - 05-25-2004 , 12:39 PM



Aarni Ruuhimäki wrote:

Quote:
Hi,

And thanks for the tip Tom.

There was a slight contradiction in this:

"country" integer DEFAULT '' NOT NULL,
How was possible for you create that table ?

on 7.4.1 I get:

test=# create table test ( b integer, a integer default '' not null );
ERROR: invalid input syntax for integer: ""

test=# alter table test alter column b set default '' ;
ERROR: invalid input syntax for integer: ""




Regards
Gaetano Mendola


Reply With Quote
  #5  
Old   
Tom Lane
 
Posts: n/a

Default Re: Fwd: Re: Sequence error ? - 05-25-2004 , 01:53 PM



Gaetano Mendola <mendola (AT) bigfoot (DOT) com> writes:
Quote:
Aarni Ruuhimäki wrote:
There was a slight contradiction in this:
"country" integer DEFAULT '' NOT NULL,

How was possible for you create that table ?

on 7.4.1 I get:

test=# create table test ( b integer, a integer default '' not null );
ERROR: invalid input syntax for integer: ""
Yeah, but before 7.3 pg_atoi would have silently accepted '' as meaning
zero. So the problem wouldn't show up until Aarni updated ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.