473,385 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

dump/restore problem


Hello,

I have a dump created with pg_dump ver 7.4.1 from a postgres 7.4 database,
with encoding SQL_ASCII.
I'm trying to import this dump in a 7.4.1 postgres database with encoding
UNICODE, but I'm getting some errors:

psql:dump.sql:1277: ERROR: invalid memory alloc request size
1073741824
psql:dump.sql:3490: ERROR: invalid byte sequence for encoding
"UNICODE": 0xce20
CONTEXT: COPY products, line 1, column ldesc: "<li>capacitate de spalare
5 kg^M
<li>viteza de centrifugare 800 rpm^M
<li>18 programe variate de spala..."
psql:dump.sql:5414: ERROR: invalid memory alloc request size
1073741824
psql:dump.sql:5577: ERROR: invalid byte sequence for encoding
"UNICODE": 0xd650
CONTEXT: COPY feedback, line 26, column comments: "Stimata Doamna/Domn,^M
^M
As dori sa achizitionez un aparat de tuns Philishave HQC888, pe care, cu
toa..."
What can I do ?

Thanks.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 22 '05 #1
3 6674
Andrei Ivanov <an***********@ines.ro> writes:
I have a dump created with pg_dump ver 7.4.1 from a postgres 7.4 database,
with encoding SQL_ASCII.
I'm trying to import this dump in a 7.4.1 postgres database with encoding
UNICODE, but I'm getting some errors: psql:dump.sql:1277: ERROR: invalid memory alloc request size
1073741824
psql:dump.sql:3490: ERROR: invalid byte sequence for encoding
"UNICODE": 0xce20


The "invalid byte sequence" problem occurs because you are trying to
load data that isn't valid UNICODE. You need to fix the data.

I'm more interested in the "invalid memory alloc request" messages,
myself. Could you show us the sections of the dump file that trigger
those errors?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #2
Andrei Ivanov <an***********@ines.ro> writes:
You will find more info attached.
I could not reproduce the "out of memory" failure using this information
(I got "invalid byte sequence" instead, on both of those COPY commands).
What exactly is the declaration of the tables being copied into?
What about the invalid UNICODE data ? How can I fix it ?


It looks like your data is in a single-byte encoding, perhaps latin1 or
one of its siblings. To convert to unicode you will first have to
identify just what encoding you're really using. Then put a "set
client_encoding = whatever;" command at the top of the dump script (or
set it in postgresql.conf, if that seems easier) and you should be able
to import.

regards, tom lane

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

Nov 22 '05 #3


I've set the encoding to LATIN2 and everything worked fine... no encoding
errors and no memory allocation failures...

The tables where the memory failures occured are:

CREATE TABLE press_releases (
id serial NOT NULL,
title character varying(255) NOT NULL,
body text NOT NULL,
tdate date DEFAULT ('NOW'::text)::date NOT NULL
);

CREATE TABLE symbols (
id serial NOT NULL,
name character varying(255) NOT NULL,
description text NOT NULL
);

I was previously trying with encoding set to SQL_ASCII, because that was
the encoding of the database from which the data was taken from and where
everything was working fine with php, but I was having troubles with java
displaying the characters wrong... now I'm trying to see if with the data
converted to unicode works.

Thanks.

On Wed, 14 Jan 2004, Tom Lane wrote:
Andrei Ivanov <an***********@ines.ro> writes:
You will find more info attached.


I could not reproduce the "out of memory" failure using this information
(I got "invalid byte sequence" instead, on both of those COPY commands).
What exactly is the declaration of the tables being copied into?
What about the invalid UNICODE data ? How can I fix it ?


It looks like your data is in a single-byte encoding, perhaps latin1 or
one of its siblings. To convert to unicode you will first have to
identify just what encoding you're really using. Then put a "set
client_encoding = whatever;" command at the top of the dump script (or
set it in postgresql.conf, if that seems easier) and you should be able
to import.

regards, tom lane


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #4

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

Similar topics

3
by: Sugapablo | last post by:
Tried googling, but I guess I have the wrong terminology for MS products. Using PostgreSQL, or MySQL, if I wanted to tranfer a database from one machine to another, I'd do a "dump" with a single...
2
by: D. Dante Lorenso | last post by:
First I created a function that selected the next available pin code from a table of pre-defined pin codes: CREATE FUNCTION "public"."get_next_pin_code" () RETURNS varchar AS' DECLARE...
7
by: Cyril VELTER | last post by:
I'm trying to dump a database from a 7.1.3 server to a 7.4.2 one. It doesn't works because of difference in COPY format (unless I use -d which is VERY slow on a 16G database). What are the...
6
by: Együd Csaba | last post by:
Hi All, I'd like to dump out my database using plain text format. Everything is ok, but the bytea filds. Restoring the dump file (using <<psql -f LO_TRY_INSERT_BYTEA.sql tmp7>>) it sends an...
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 kernel, the storage is handled by 5 SATA disks,...
5
by: Chris Stankevitz | last post by:
My app reliably dies after a long time. I would like to dump core before it dies, and use that core as a starting point in debugging to save me from having to spend so much time waiting. Is...
1
by: ntech | last post by:
Hello, i am facing a problem. I am using postgresql database in Linux. After taking the dump of any postgresql database, when i restore the dump file into a new database, i dont get any oids. so can...
0
by: bogie | last post by:
Hello every one, I have a problem to restore my postgresql dumpfile. I have a postgresql database 7.3.2 in a linux environment and i want to restore the dumpfile that i make from linux environment...
2
by: clearissues | last post by:
Hi All, I have a python script which takes dump of postgres and restores the same. When i take a dump there is no problem. command to take dump: pg_dump -b -c -C --format=c -d -h <<hostname>>...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.