Thread: pg_dump, bytea, dump order questions

pg_dump, bytea, dump order questions

From
Együd Csaba
Date:
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.



Re: pg_dump, bytea, dump order questions

From
Együd Csaba
Date:
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: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Együd Csaba
> Sent: 2004. június 7. 10:38
> To: Pgsql-General@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
> majordomo@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.



Re: pg_dump, bytea, dump order questions

From
Shridhar Daithankar
Date:
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

Re: pg_dump, bytea, dump order questions

From
Együd Csaba
Date:
Hi Shridhar,
thank you for your reply. It is really a good idea. I'll think it over.

Many thanks,
  -- Csaba

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Shridhar
> Daithankar
> Sent: 2004. június 7. 13:59
> To: csegyud@vnet.hu
> Cc: 'Pgsql-General@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
> majordomo@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.