472,328 Members | 1,102 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

pg_dump 7.2.3, pg_restore 7.3.3

Hi!

I dumped a DB using pg_dump from version 7.2.3
and tried to read it into DB with psql|pg_restore of version 7.3.3.
I got an error 'pg_atoi: zero-length string' during the creation
of relations. Don't know what to do with it.

TIA
--
Marcin "Dentharg" Gil
RLU# 221865 :: email# mgil (at) vernet pl
G-G# 185057 :: JID# dentharg (at) chrome pl
Jul 19 '05 #1
6 3429
Did it give you any indication of which line caused the error? If so,
start there. pg_atoi() is the method used to convert ascii to integer,
so you can search for the function call and see what's calling it. Also,
in the migration notes it says that "An empty string ('') is no longer
allowed as the input into an integer field. Formerly, it was silently
interpreted as 0." Could this be related?

Good luck
Ron
Marcin Gil wrote:
Hi!

I dumped a DB using pg_dump from version 7.2.3
and tried to read it into DB with psql|pg_restore of version 7.3.3.
I got an error 'pg_atoi: zero-length string' during the creation
of relations. Don't know what to do with it.

TIA


Jul 19 '05 #2
W artykule <l2***********************@news2.calgary.shaw.ca > rstp napisał(a):
Did it give you any indication of which line caused the error? If so,
start there. pg_atoi() is the method used to convert ascii to integer,
so you can search for the function call and see what's calling it. Also,
in the migration notes it says that "An empty string ('') is no longer
allowed as the input into an integer field. Formerly, it was silently
interpreted as 0." Could this be related?


Following a cut from my dump.
It causes an pg_atoi() error in creation of co_sys_meta_vtable.

--
-- TOC Entry ID 101 (OID 16855)
--
-- Name: co_sys_meta_vtable_sqid Type: SEQUENCE Owner: root
--

CREATE SEQUENCE "co_sys_meta_vtable_sqid" start 1 increment 1
maxvalue 9223372036854775807 minvalue 1 cache 1;

--
-- TOC Entry ID 103 (OID 16855)
--
-- Name: co_sys_meta_vtable_sqid Type: ACL Owner:
--

REVOKE ALL on "co_sys_meta_vtable_sqid" from PUBLIC;
GRANT ALL on "co_sys_meta_vtable_sqid" to "root";
GRANT ALL on "co_sys_meta_vtable_sqid" to "nobody";

--
-- TOC Entry ID 411 (OID 16857)
--
-- Name: co_sys_meta_vtable Type: TABLE Owner: root
--

CREATE TABLE "co_sys_meta_vtable" (
"id" integer DEFAULT nextval('co_sys_meta_vtable_sqid'::text),
"version" integer DEFAULT 0,
"deleted" integer DEFAULT 0,
"inherits_acl" integer DEFAULT 1,
"area" text DEFAULT 'sys',
"class_name" text DEFAULT '',
"method_name" text DEFAULT '',
"target_area" text DEFAULT 'sys',
"target_class_name" text DEFAULT '',
"id_permission" integer DEFAULT '',
"id_onbefore_script" integer DEFAULT 0,
"id_onbefore_method" integer DEFAULT 0,
"id_script" integer DEFAULT 0,
"id_onafter_script" integer DEFAULT 0,
"id_onafter_method" integer DEFAULT 0,
"profiled" integer DEFAULT 0,
"sec_type" integer DEFAULT 0,
"force_sec_type" integer DEFAULT 0
);

TIA
--
Marcin "Dentharg" Gil
RLU# 221865 :: email# mgil (at) vernet pl
G-G# 185057 :: JID# dentharg (at) chrome pl
Jul 19 '05 #3
> "id" integer DEFAULT nextval('co_sys_meta_vtable_sqid'::text),
????????????
The sequence is being cast to text. I'd recommend that you change the
line in your pg_dump file from :
"id" integer DEFAULT nextval('co_sys_meta_vtable_sqid'::text), to: "id" integer, and then after the database has started
DROP SEQUENCE 'co_sys_meta_vtable_sqid'
then
CREATE SEQUENCE 'co_sys_meta_vtable_sqid' ....
Check the documentation for correct form, and you can initialize the
sequence to the next val. Maybe along the lines of
SELECT setval('co_sys_meta_vtable_sqid', (max(ID) + 1)) FROM myTable;

Unless you have this problem with all of your sequences, this is a
quick-fix.

hth
Ron
Marcin Gil wrote: W artykule <l2***********************@news2.calgary.shaw.ca > rstp napisał(a):

Did it give you any indication of which line caused the error? If so,
start there. pg_atoi() is the method used to convert ascii to integer,
so you can search for the function call and see what's calling it. Also,
in the migration notes it says that "An empty string ('') is no longer
allowed as the input into an integer field. Formerly, it was silently
interpreted as 0." Could this be related?

Following a cut from my dump.
It causes an pg_atoi() error in creation of co_sys_meta_vtable.

--
-- TOC Entry ID 101 (OID 16855)
--
-- Name: co_sys_meta_vtable_sqid Type: SEQUENCE Owner: root
--

CREATE SEQUENCE "co_sys_meta_vtable_sqid" start 1 increment 1
maxvalue 9223372036854775807 minvalue 1 cache 1;

--
-- TOC Entry ID 103 (OID 16855)
--
-- Name: co_sys_meta_vtable_sqid Type: ACL Owner:
--

REVOKE ALL on "co_sys_meta_vtable_sqid" from PUBLIC;
GRANT ALL on "co_sys_meta_vtable_sqid" to "root";
GRANT ALL on "co_sys_meta_vtable_sqid" to "nobody";

--
-- TOC Entry ID 411 (OID 16857)
--
-- Name: co_sys_meta_vtable Type: TABLE Owner: root
--

CREATE TABLE "co_sys_meta_vtable" (
"id" integer DEFAULT nextval('co_sys_meta_vtable_sqid'::text),
"version" integer DEFAULT 0,
"deleted" integer DEFAULT 0,
"inherits_acl" integer DEFAULT 1,
"area" text DEFAULT 'sys',
"class_name" text DEFAULT '',
"method_name" text DEFAULT '',
"target_area" text DEFAULT 'sys',
"target_class_name" text DEFAULT '',
"id_permission" integer DEFAULT '',
"id_onbefore_script" integer DEFAULT 0,
"id_onbefore_method" integer DEFAULT 0,
"id_script" integer DEFAULT 0,
"id_onafter_script" integer DEFAULT 0,
"id_onafter_method" integer DEFAULT 0,
"profiled" integer DEFAULT 0,
"sec_type" integer DEFAULT 0,
"force_sec_type" integer DEFAULT 0
);

TIA


Jul 19 '05 #4
W artykule <oI***********************@news3.calgary.shaw.ca > rstp napisał(a):
Unless you have this problem with all of your sequences, this is a
quick-fix.

That's the problem. The dump has almost 3G, and lotsa
fixes would be needed.

--
Marcin "Dentharg" Gil
RLU# 221865 :: email# mgil (at) vernet pl
G-G# 185057 :: JID# dentharg (at) chrome pl
Jul 19 '05 #5
Marcin Gil wrote:
W artykule <oI***********************@news3.calgary.shaw.ca > rstp napisał(a):
Unless you have this problem with all of your sequences, this is a
quick-fix.


That's the problem. The dump has almost 3G, and lotsa
fixes would be needed.


Hmmm....... that's a problem. I suggest that you post your problem on
the discussion boards at postgresql.org. You have to sign up for them
first (send them your email address), but it's very quick. There's much
more activity there and there is likely to be someone who knows what to
do. If you do find a solution there, please post it back to this group.

Ron

Jul 19 '05 #6
Hi,

I would dump the schema and the data separately, and then split the schema
into two pieces, the table creation portion, and the table modification
portion (constraints, etc.), then fix the table creation section in an
editor, and load them into the new database in the order: table creation,
then data, then modifications. This is the order a full pg_dump is in, but
it would be too big to edit easily to correct the table creation code
quickly with an editor. this assumes of course that you have 3 gig of data,
not 3 gig of schema :-D

Sean
Web Solutions That Work Developing custom web solutions designed
specifically to accomplish the unique objectives of our clients. Phone
503-639-2727 Fax 503-639-0807
"rstp" <rs**@linuxwaves.com> wrote in message
news:sG***********************@news1.calgary.shaw. ca...
Marcin Gil wrote:
W artykule <oI***********************@news3.calgary.shaw.ca > rstp napisał(a):
Unless you have this problem with all of your sequences, this is a
quick-fix.


That's the problem. The dump has almost 3G, and lotsa
fixes would be needed.


Hmmm....... that's a problem. I suggest that you post your problem on
the discussion boards at postgresql.org. You have to sign up for them
first (send them your email address), but it's very quick. There's much
more activity there and there is likely to be someone who knows what to
do. If you do find a solution there, please post it back to this group.

Ron

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sam | last post by:
I'm having trouble restoring databases that have to lo type installed in /contrib/lo. The dump seems to work just fine, I get no errors when I...
4
by: Mark Mikulec | last post by:
Hi there, I wonder if anyone can shed some light on a very frustrating problem. I'm running a debian linux 3.0 "woody" server, nothing special,...
7
by: Howard Lowndes | last post by:
My situation is that I am interacting PHP 4.1.2 to PostgreSQL 7.2.2 I have no difficulty inserting and managing BLOBs into the Large Object...
1
by: Ruth Hsieh | last post by:
The postgreSQL release used is 7.3.4. We would like to dump the objects for particular user. How? I used -U option, the result still dump all the...
0
by: Aienthiwan | last post by:
Hello all, I'm running a debian server and recently updated my version of PostgreSQL to "unstable", that being v7.4.1. I had no trouble at all...
6
by: Michal Hlavac | last post by:
Hellou, when I use pg_dump database > dump.dat on database with tsearch2 and then psql database < dump.dat - this command fails, because in...
6
by: Soeren Gerlach | last post by:
Hi, some weeks ago I started to develop an application using Postgresql the first time. I'm running 7.4.3 on a Linux box with a plain 2.6.7...
0
by: Otto Blomqvist | last post by:
Hello ! I was just wondering if anyone knows if this is a bug or whats up. Im using psql 7.2.2 I can do full restores and dumps all day...
1
by: Neil Zanella | last post by:
Hello, I have an SQL database which I create with: psql -f create.sql foodb I then access this database and perform several insertions,...
0
by: aktivo | last post by:
pg_dump remove name of schema from default value. i don't know why. how can i solve this problem ? For example: BEFORE PG_DUMP: CREATE TABLE...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.