473,593 Members | 2,925 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_B YTEA.sql tmp7>>) it
sends an error message like
psql:LO_TRY_INS ERT_BYTEA.sql:1 4: ERROR: Bad input string for type bytea

Trying dumping with copy commands it sends this error:
psql:LO_TRY_COP Y_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*******@postg resql.org

Nov 23 '05 #1
6 3515
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****** ***********@pos tgresql.org]On Behalf Of Együd Csaba
Sent: 2004. június 7. 10:38
To: Pg***********@P ostgresql.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_B YTEA.sql tmp7>>) it
sends an error message like
psql:LO_TRY_INS ERT_BYTEA.sql:1 4: ERROR: Bad input string
for type bytea

Trying dumping with copy commands it sends this error:
psql:LO_TRY_COP Y_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*******@postg resql.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****** ***********@pos tgresql.org]On Behalf Of Együd Csaba
Sent: 2004. június 7. 10:38
To: Pg***********@P ostgresql.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_B YTEA.sql tmp7>>) it
sends an error message like
psql:LO_TRY_INS ERT_BYTEA.sql:1 4: ERROR: Bad input string
for type bytea

Trying dumping with copy commands it sends this error:
psql:LO_TRY_COP Y_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*******@postg resql.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 YourEmailAddres sHere" to ma*******@postg resql.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 YourEmailAddres sHere" to ma*******@postg resql.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****** ***********@pos tgresql.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 YourEmailAddres sHere" to
ma*******@postg resql.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 YourEmailAddres sHere" to ma*******@postg resql.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****** ***********@pos tgresql.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 YourEmailAddres sHere" to
ma*******@postg resql.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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 23 '05 #7

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

Similar topics

1
1834
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...
7
4826
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 mix of 7.2.3, 7.3.2, and 7.3.4 (mostly 7.3.4), 10gb ram, 76gb on a RAID5, dual cpus, and very busy with hundreds and sometimes > 1000 simultaneous connections. After ~250 days of continuous, flawless uptime operations, we recently began...
1
3272
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 j&aacute;t&eacute;k J-0001 1502450E Szuper Pok&eacute;mon aj&aacute;nd&eacute;kcso..." ERROR: duplicate key violates unique constraint "attributes_pkey" CONTEXT: COPY attributes, line 1: "2 Width" ERROR: duplicate key violates...
6
2018
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??
0
333
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 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
1
1862
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
6
2259
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 Chipitsine
2
2702
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, I've only ever dumped both, and have never had a problem restoring into older/newer versions of postgres, nor with restoring into other commercial versions of postgres. This is a testament of the robustness of pg_dump! Of course, there are always a...
4
4476
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 solve it. (There are double apostophes many times in the string - is it normal??? Besides of the field separator of course...) Many thanks, Csaba Együd
0
7871
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8236
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...
0
8366
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7995
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,...
0
8227
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6642
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3851
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...
1
2379
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
1
1467
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.