dbTalk Databases Forums  

[BUGS] pg_dumpall bug & feature request

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] pg_dumpall bug & feature request in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ivan
 
Posts: n/a

Default [BUGS] pg_dumpall bug & feature request - 11-03-2005 , 03:05 AM






Hello,

Perhaps you missed my previous message.
pg_dumpall has not -f command line option
to specify output file - it always send output
to standart output. But there is an issue with
it in Windows (I described it earlier) - function's
line endings are changed from 0D 0A to 0D 0D 0A.

Could you please add -f option to pg_dumpall,
because it's very inconvenient to replace these
character sequences in hex editor all the time.

Thank you for support!

--
Best regards,
Ivan mailto:Ivan-Sun1 (AT) mail (DOT) ru


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply With Quote
  #2  
Old   
Alvaro Herrera
 
Posts: n/a

Default Re: [BUGS] pg_dumpall bug & feature request - 11-03-2005 , 07:57 AM






Ivan wrote:

Hi,

Quote:
Perhaps you missed my previous message.
pg_dumpall has not -f command line option
to specify output file - it always send output
to standart output. But there is an issue with
it in Windows (I described it earlier) - function's
line endings are changed from 0D 0A to 0D 0D 0A.
Hmm, what do you need that for? Why don't you directly restore the
binary dump to a database by using option -d?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
  #3  
Old   
Ivan
 
Posts: n/a

Default Re: [BUGS] pg_dumpall bug & feature request - 11-03-2005 , 08:40 AM



Hello Alvaro,

Thursday, November 3, 2005, 3:28:41 PM, you wrote:

AH> Ivan wrote:

AH> Hi,

Quote:
Perhaps you missed my previous message.
pg_dumpall has not -f command line option
to specify output file - it always send output
to standart output. But there is an issue with
it in Windows (I described it earlier) - function's
line endings are changed from 0D 0A to 0D 0D 0A.
AH> Hmm, what do you need that for? Why don't you directly restore the
AH> binary dump to a database by using option -d?

I don't need to restore binary dump. I need to make a dump of the
whole database cluster to plain sql file (what pg_dumpall does).
So I have to redirect pg_dumpall's output to a file
pg_dump [options] > cluster_dump.sql
When I do it on Windows, it creates cluster_dump.sql file
BUT in that file all sql and plpgsql function bodies are corrupted! -
each line in the body ends with 0D 0D 0A sequence instead of 0D 0A -
therefor functions after restoring looks like:

CREATE OR REPLACE FUNCTION "foo"()
RETURNS bar AS
$$

select * from "bar"

where bla-bla

order by bla-bla;

$$
LANGUAGE 'sql' VOLATILE;

instead of

CREATE OR REPLACE FUNCTION "foo"()
RETURNS bar AS
$$
select * from "bar"
where bla-bla
order by bla-bla;
$$
LANGUAGE 'sql' VOLATILE;

- extra blank lines are added.

So it would be great if the output redirection ">" will be workaround
for example the same way like in pg_dump it is done - via -f file
option.

Thank you for support.

--
Best regards,
Ivan mailto:Ivan-Sun1 (AT) mail (DOT) ru


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
  #4  
Old   
Alvaro Herrera
 
Posts: n/a

Default Re: [BUGS] pg_dumpall bug & feature request - 11-03-2005 , 09:55 AM



Ivan wrote:

Hi,

Quote:
Thursday, November 3, 2005, 3:28:41 PM, you wrote:

Perhaps you missed my previous message.
pg_dumpall has not -f command line option
to specify output file - it always send output
to standart output. But there is an issue with
it in Windows (I described it earlier) - function's
line endings are changed from 0D 0A to 0D 0D 0A.

AH> Hmm, what do you need that for? Why don't you directly restore the
AH> binary dump to a database by using option -d?

I don't need to restore binary dump. I need to make a dump of the
whole database cluster to plain sql file (what pg_dumpall does).
So I have to redirect pg_dumpall's output to a file
pg_dump [options] > cluster_dump.sql
Hum, doh! I misread your message as thought it referred to pg_restore
rather than pg_dumpall. Not sure why. Certainly pg_dumpall needs a
redirecting feature. I imagine there must be a way to tell the shell
not to do newline translation, but I wouldn't know it.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.