473,804 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3496
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************ ***********@new s2.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_vta ble.

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

CREATE SEQUENCE "co_sys_meta_vt able_sqid" start 1 increment 1
maxvalue 922337203685477 5807 minvalue 1 cache 1;

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

REVOKE ALL on "co_sys_meta_vt able_sqid" from PUBLIC;
GRANT ALL on "co_sys_meta_vt able_sqid" to "root";
GRANT ALL on "co_sys_meta_vt able_sqid" to "nobody";

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

CREATE TABLE "co_sys_meta_vt able" (
"id" integer DEFAULT nextval('co_sys _meta_vtable_sq id'::text),
"version" integer DEFAULT 0,
"deleted" integer DEFAULT 0,
"inherits_a cl" integer DEFAULT 1,
"area" text DEFAULT 'sys',
"class_name " text DEFAULT '',
"method_nam e" text DEFAULT '',
"target_are a" text DEFAULT 'sys',
"target_class_n ame" text DEFAULT '',
"id_permiss ion" integer DEFAULT '',
"id_onbefore_sc ript" integer DEFAULT 0,
"id_onbefore_me thod" integer DEFAULT 0,
"id_script" integer DEFAULT 0,
"id_onafter_scr ipt" integer DEFAULT 0,
"id_onafter_met hod" 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_sq id'::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_sq id'::text), to: "id" integer, and then after the database has started
DROP SEQUENCE 'co_sys_meta_vt able_sqid'
then
CREATE SEQUENCE 'co_sys_meta_vt able_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_sqi d', (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************ ***********@new s2.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_vta ble.

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

CREATE SEQUENCE "co_sys_meta_vt able_sqid" start 1 increment 1
maxvalue 922337203685477 5807 minvalue 1 cache 1;

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

REVOKE ALL on "co_sys_meta_vt able_sqid" from PUBLIC;
GRANT ALL on "co_sys_meta_vt able_sqid" to "root";
GRANT ALL on "co_sys_meta_vt able_sqid" to "nobody";

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

CREATE TABLE "co_sys_meta_vt able" (
"id" integer DEFAULT nextval('co_sys _meta_vtable_sq id'::text),
"version" integer DEFAULT 0,
"deleted" integer DEFAULT 0,
"inherits_a cl" integer DEFAULT 1,
"area" text DEFAULT 'sys',
"class_name " text DEFAULT '',
"method_nam e" text DEFAULT '',
"target_are a" text DEFAULT 'sys',
"target_class_n ame" text DEFAULT '',
"id_permiss ion" integer DEFAULT '',
"id_onbefore_sc ript" integer DEFAULT 0,
"id_onbefore_me thod" integer DEFAULT 0,
"id_script" integer DEFAULT 0,
"id_onafter_scr ipt" integer DEFAULT 0,
"id_onafter_met hod" 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************ ***********@new s3.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************ ***********@new s3.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**@linuxwave s.com> wrote in message
news:sG******** *************** @news1.calgary. shaw.ca...
Marcin Gil wrote:
W artykule <oI************ ***********@new s3.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
3767
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 execute the following command #pg_dump -Fc -o -b mydb > mydb_dump > CREATE DATABASE mydb_restore TEMPLATE template0
4
4466
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, with the latest version of postres that apt-get will allow me, which I *think* it;s 7.1 something, I don't know how to figure out the postgres version. Anywho - I'm trying to backup my databases, which I did at one point, but I have no idea what happened, could have been an upgrade. My Dbs...
7
6957
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 system table, and I have a user table called images which maintains the relationship between the BLOB loid and the identity that relates to it in my user tables. So far so good. When I RTFM obout psql it refers to the \lo_import, \lo_list, \lo_export and \lo_unlink functions.
1
1850
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 objects with all the users. In order to migrate to 7.4, if the users were not created in 7.4 the pg_dump result will fail or create under wrong user. How to prevent this? What is different between pg_restore and psql if restore the pg_dump result? I tried to use pg_restore, but it always...
0
1863
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 getting everything up to date and going. But my auto-database backup scripts do not work any more: I get this error when I try to do a pg_dump with the new version of Postgres:
6
2037
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 dump.dat is declaration of tsearch2 procedures and types after main schema, which is using tsearch2. is this patch for this??
6
11325
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 kernel, the storage is handled by 5 SATA disks, managed by a 3ware controller and using a xfs filesystem. The DB server is a 3 Ghz P4 with 4 Gig of Ram, so the machine is quite fast for most purposes I need it; the DB server is a pure DB server, theres no application running on it. I dump and...
0
1414
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 long, however when I do the following I run into problems Do a full dump with pg_dump -Fc -O Database1 > dump.tar
1
1878
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, modifications, and deletions. Finally, I want to backup my database. I do not want to backup the schema. All I want is a set of insert statements stored in a file insert.sql which I can run on a set of empty database tables
0
2154
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 "is8"."tb_kotuce" ( "id_kotuc" CHAR(10) DEFAULT is8.fn_sq_id_kotuc() NOT NULL, ... ...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.