By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,478 Members | 1,833 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,478 IT Pros & Developers. It's quick & easy.

pg_dump, bytea, dump order questions

P: n/a
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,
-- Egyd 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
Share this Question
Share on Google+
6 Replies


P: n/a
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 Egyd
-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.org]On Behalf Of Egyd Csaba
Sent: 2004. jnius 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,
-- Egyd 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

P: n/a
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 Egyd
-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.org]On Behalf Of Egyd Csaba
Sent: 2004. jnius 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,
-- Egyd 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

P: n/a
Egyd 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

P: n/a
Egyd 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

P: n/a
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. jnius 7. 13:59
To: cs*****@vnet.hu
Cc: 'P************@Postgresql.Org (E-mail)'
Subject: Re: [GENERAL] pg_dump, bytea, dump order questions
Egyd 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

P: n/a
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. jnius 7. 13:59
To: cs*****@vnet.hu
Cc: 'P************@Postgresql.Org (E-mail)'
Subject: Re: [GENERAL] pg_dump, bytea, dump order questions
Egyd 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 discussion thread is closed

Replies have been disabled for this discussion.