?
Solved

pg_dump, problems with restore

Posted on 2010-11-17
2
Medium Priority
?
716 Views
Last Modified: 2012-05-10
Hi Experts,

I just dumped a postgres db with:
pg_dump mydb > mydb.dmp

Open in new window


then dropped it and recreated it:
postgres=#drop database mydb;
postgres=#create database mydb;
postgres=#grant all privileges on database mydb to myuser;

Open in new window


and tried to restore it with:
psql mydb < mydb.dmp

Open in new window


... and got lots of errors looking like this:
ERROR:  value too long for type character varying(80)

Open in new window


How can that happen?
0
Comment
Question by:alpha-lemming
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Hatrix76 earned 2000 total points
ID: 34154731
did you create the database with another encoding? like you created it now with ASCII and the dump was in UTF-8? that could be a problem (multibyte versus string).

it would be good if you can provide more information on the current created database and if possible the data which fails to be inserted.

0
 

Author Closing Comment

by:alpha-lemming
ID: 34204601
That was it, exactly!
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question