473,404 Members | 2,114 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,404 software developers and data experts.

pg_dump, bytea, dump order questions

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 error message like
psql:LO_TRY_INSERT_BYTEA.sql:14: ERROR: Bad input string for type bytea

Trying dumping with copy commands it sends this error:
psql:LO_TRY_COPY_BYTEA.sql:13: lost synchronization with server, resetting
connection

I used <<pg_dump -d ...>> and <<pg_dump ...>> formats for creating dump
files.
How should I use pg_dump to make it able to back my binary data correctly?

An other question. How can I make psql to change the dupm order of db
objects? My problem is, that one of my table fields has a default clasuse
using a plpgsql function. As being functions dumped after table definitions
creating these tables fail. What can I do in order to avoid these problems -
without modifying every dump file by hand?
Any help is appreciated.

Thank you,
-- Együd Csaba

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #1
6 3492
Hi,
answering partially my questions the first problem is actualy solved. My
text editor inserted a linebreak into the middle of the row at position
16384. :) Should change my editor...??? :)

The other question is yet a question. Is there any way to dump first the
functions and then the table definitions?

Thank you very much,
-- Csaba Együd
-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.org]On Behalf Of Együd Csaba
Sent: 2004. június 7. 10:38
To: Pg***********@Postgresql.Org (E-mail)
Subject: [GENERAL] pg_dump, bytea, dump order questions
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 error message like
psql:LO_TRY_INSERT_BYTEA.sql:14: ERROR: Bad input string
for type bytea

Trying dumping with copy commands it sends this error:
psql:LO_TRY_COPY_BYTEA.sql:13: lost synchronization with
server, resetting
connection

I used <<pg_dump -d ...>> and <<pg_dump ...>> formats for
creating dump
files.
How should I use pg_dump to make it able to back my binary
data correctly?

An other question. How can I make psql to change the dupm order of db
objects? My problem is, that one of my table fields has a
default clasuse
using a plpgsql function. As being functions dumped after
table definitions
creating these tables fail. What can I do in order to avoid
these problems -
without modifying every dump file by hand?
Any help is appreciated.

Thank you,
-- Együd Csaba

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.

---------------------------(end of
broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to
ma*******@postgresql.org

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.

---------------------------(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

Nov 23 '05 #2
Hi,
answering partially my questions the first problem is actualy solved. My
text editor inserted a linebreak into the middle of the row at position
16384. :) Should change my editor...??? :)

The other question is yet a question. Is there any way to dump first the
functions and then the table definitions?

Thank you very much,
-- Csaba Együd
-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.org]On Behalf Of Együd Csaba
Sent: 2004. június 7. 10:38
To: Pg***********@Postgresql.Org (E-mail)
Subject: [GENERAL] pg_dump, bytea, dump order questions
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 error message like
psql:LO_TRY_INSERT_BYTEA.sql:14: ERROR: Bad input string
for type bytea

Trying dumping with copy commands it sends this error:
psql:LO_TRY_COPY_BYTEA.sql:13: lost synchronization with
server, resetting
connection

I used <<pg_dump -d ...>> and <<pg_dump ...>> formats for
creating dump
files.
How should I use pg_dump to make it able to back my binary
data correctly?

An other question. How can I make psql to change the dupm order of db
objects? My problem is, that one of my table fields has a
default clasuse
using a plpgsql function. As being functions dumped after
table definitions
creating these tables fail. What can I do in order to avoid
these problems -
without modifying every dump file by hand?
Any help is appreciated.

Thank you,
-- Együd Csaba

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.

---------------------------(end of
broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to
ma*******@postgresql.org

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.

---------------------------(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

Nov 23 '05 #3
Együd Csaba wrote:
Hi,
answering partially my questions the first problem is actualy solved. My
text editor inserted a linebreak into the middle of the row at position
16384. :) Should change my editor...??? :)

The other question is yet a question. Is there any way to dump first the
functions and then the table definitions?


If you have the functions in separate schema/database, you can manually
dump/restore that first.

HTH

Shridhar

---------------------------(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 23 '05 #4
Együd Csaba wrote:
Hi,
answering partially my questions the first problem is actualy solved. My
text editor inserted a linebreak into the middle of the row at position
16384. :) Should change my editor...??? :)

The other question is yet a question. Is there any way to dump first the
functions and then the table definitions?


If you have the functions in separate schema/database, you can manually
dump/restore that first.

HTH

Shridhar

---------------------------(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 23 '05 #5
Hi Shridhar,
thank you for your reply. It is really a good idea. I'll think it over.

Many thanks,
-- Csaba
-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.org]On Behalf Of Shridhar
Daithankar
Sent: 2004. június 7. 13:59
To: cs*****@vnet.hu
Cc: 'P************@Postgresql.Org (E-mail)'
Subject: Re: [GENERAL] pg_dump, bytea, dump order questions
Együd Csaba wrote:
Hi,
answering partially my questions the first problem is

actualy solved. My
text editor inserted a linebreak into the middle of the row

at position
16384. :) Should change my editor...??? :)

The other question is yet a question. Is there any way to

dump first the
functions and then the table definitions?


If you have the functions in separate schema/database, you
can manually
dump/restore that first.

HTH

Shridhar

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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.

---------------------------(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 23 '05 #6
Hi Shridhar,
thank you for your reply. It is really a good idea. I'll think it over.

Many thanks,
-- Csaba
-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.org]On Behalf Of Shridhar
Daithankar
Sent: 2004. június 7. 13:59
To: cs*****@vnet.hu
Cc: 'P************@Postgresql.Org (E-mail)'
Subject: Re: [GENERAL] pg_dump, bytea, dump order questions
Együd Csaba wrote:
Hi,
answering partially my questions the first problem is

actualy solved. My
text editor inserted a linebreak into the middle of the row

at position
16384. :) Should change my editor...??? :)

The other question is yet a question. Is there any way to

dump first the
functions and then the table definitions?


If you have the functions in separate schema/database, you
can manually
dump/restore that first.

HTH

Shridhar

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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 2004. 06. 04.

---------------------------(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 23 '05 #7

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

Similar topics

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 objects with all the users. In order to...
7
by: Ed L. | last post by:
We are seeing what looks like pgsql data file corruption across multiple clusters on a RAID5 partition on a single redhat linux 2.4 server running 7.3.4. System has ~20 clusters installed with a...
1
by: Ben-Nes Michael | last post by:
Hello Im getting strange errors when restoring data from pg_dump files: ERROR: duplicate key violates unique constraint "products_pkey" CONTEXT: COPY products, line 1: "98 Super Pak Ruby...
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 dump.dat is declaration of tsearch2 procedures and...
0
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...
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, modifications, and deletions. Finally, I want to...
6
by: Ilia Chipitsine | last post by:
Dear Sirs, I want to dump all databases, but separately each database in its own file, not all databases in one single file as pg_dumpall does. How can I implement that ? Cheers, Ilia...
2
by: Anony Mous | last post by:
Hi, I've seen in previous posts that recommended practice for database backup is to run the dump utility twice. Once for schema only and a second time for data only (I think). Up to know,...
4
by: Együd Csaba | last post by:
Hi, the restoration of a dump stops at the line above. The dump was created with pgsql 7.3.2 and I need to pump it into a 7.4.3 one. Should anybody tell me what the problem can be and how I can...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.