Thread: problem with pg_restore?

problem with pg_restore?

From
Jim Michaels
Date:
I am having problems with pg_restore.  pg_restore --file=c:\pg-jmichae3-7-13-2009.sql --verbose --host=localhost --port=5432 --username=postgres

this just hangs.
I am restoring from 8.3.7 to 8.4 - what did I do wrong?

could somebody rewrite pg_dumpall and pg_dump so that it makes editable dumps?
most programmer's text editors can't handle more than 2000 characters per line.
and I want to be able to edit my dumps.
 









Re: problem with pg_restore?

From
David Wilson
Date:
On Tue, Jul 14, 2009 at 7:47 PM, Jim Michaels<jmichae3@yahoo.com> wrote:
> could somebody rewrite pg_dumpall and pg_dump so that it makes editable
> dumps?
> most programmer's text editors can't handle more than 2000 characters per
> line.
> and I want to be able to edit my dumps.

You're going to have better luck finding a decent editor than finding
someone to rewrite pg_dump and pg_dumpall just for you.


--
- David T. Wilson
david.t.wilson@gmail.com

Re: problem with pg_restore?

From
Richard Huxton
Date:
Jim Michaels wrote:
> I am having problems with pg_restore.  pg_restore --file=c:\pg-jmichae3-7-13-2009.sql --verbose --host=localhost
--port=5432--username=postgres 
>
> this just hangs.
> I am restoring from 8.3.7 to 8.4 - what did I do wrong?

Well, I don't see a database name, was that just an accident when you
cut + pasted the line?

If so, do you see any activity at all? If you turn connection logging on
at the server, does it see any connection attempts?

> could somebody rewrite pg_dumpall and pg_dump so that it makes editable dumps?
> most programmer's text editors can't handle more than 2000 characters per line.
> and I want to be able to edit my dumps.

Might want to get a better editor. Just tried vi with 1000 character
lines and it's perfectly happy. Can't imagine a proper editor
complaining. Having said that, once your file gets into the gigabytes
you'll want more specialised tools (either an on-disk editor or sed/perl).

--
   Richard Huxton
   Archonet Ltd

Re: problem with pg_restore?

From
Thomas Kellerer
Date:
Jim Michaels, 15.07.2009 01:47:
> most programmer's text editors can't handle more than 2000 characters
> per line.
> and I want to be able to edit my dumps.

I don't know what you are using, but the following editors can certainly handle more than 2000 characters:

OpenSource and free:
http://www.pnotepad.org
http://www.pspad.com
http://notepad-plus.sourceforge.net

Commercial (but not expensive)
http://www.textpad.com

I have edited files with more than 10000 characters per line in PNotepad, PSPad and Textpad

Thomas

Re: problem with pg_restore?

From
Jasen Betts
Date:
On 2009-07-14, Jim Michaels <jmichae3@yahoo.com> wrote:
>
> --0-1060148048-1247615236=:84835
> Content-Type: text/plain; charset=us-ascii
>
> I am having problems with pg_restore.  pg_restore --file=c:\pg-jmichae3-7-13-2009.sql --verbose --host=localhost
--port=5432--username=postgres 
>
> this just hangs.
> I am restoring from 8.3.7 to 8.4 - what did I do wrong?


> could somebody rewrite pg_dumpall and pg_dump so that it makes editable dumps?
> most programmer's text editors can't handle more than 2000 characters per line.

any text editor with a line length limit shorter than 1 megabyte is a
liability.  that said if you dump as inserts there's probably a way to
use sed to split the long strings and still have a loadable dump.

> and I want to be able to edit my dumps.

I find that jed is powerful, fast, and reasonably easy to use. and had
no problem with 2.3MB lines.

gnome-text-editor ("gedit") handles lines of tens of thousands of
characters OK but seems to have problems displaying million character
lines,

I expect ther big guns "vim" and "emacs" also have no problems with
long lines.


Re: problem with pg_restore?

From
Sam Mason
Date:
On Thu, Jul 23, 2009 at 10:47:40AM +0000, Jasen Betts wrote:
> I find that jed is powerful, fast, and reasonably easy to use. and had
> no problem with 2.3MB lines.
>
> gnome-text-editor ("gedit") handles lines of tens of thousands of
> characters OK but seems to have problems displaying million character
> lines,
>
> I expect ther big guns "vim" and "emacs" also have no problems with
> long lines.

GNU Emacs is fine; just tried with a line consisting of a million copies
of "helloworld " and it was a bit slow with some operations but wasn't
as bad as I was expecting.

--
  Sam  http://samason.me.uk/

Re: problem with pg_restore?

From
Scott Marlowe
Date:
On Tue, Jul 14, 2009 at 5:47 PM, Jim Michaels<jmichae3@yahoo.com> wrote:
> I am having problems with pg_restore.  pg_restore
> --file=c:\pg-jmichae3-7-13-2009.sql --verbose --host=localhost --port=5432
> --username=postgres
>
> this just hangs.
> I am restoring from 8.3.7 to 8.4 - what did I do wrong?
>
> could somebody rewrite pg_dumpall and pg_dump so that it makes editable
> dumps?
> most programmer's text editors can't handle more than 2000 characters per
> line.
> and I want to be able to edit my dumps.

When I need to make changes to large dumps I use tools like sed, awk
and diff, not a text editor.

Re: problem with pg_restore?

From
Sam Mason
Date:
On Thu, Jul 23, 2009 at 07:40:18AM -0600, Scott Marlowe wrote:
> On Tue, Jul 14, 2009 at 5:47 PM, Jim Michaels<jmichae3@yahoo.com> wrote:
> > could somebody rewrite pg_dumpall and pg_dump so that it makes editable
> > dumps?
> > most programmer's text editors can't handle more than 2000
> > characters per line. and I want to be able to edit my dumps.
>
> When I need to make changes to large dumps I use tools like sed, awk
> and diff, not a text editor.

Indeed, but I still like to be able to use a text editor to verify that
my code is doing the right thing.  Obviously for large files (i.e. a GB
and over) it's not going to work, but I'd still expect tools to work
("less -n" seems to be my tool of choice at the moment).

--
  Sam  http://samason.me.uk/

Re: problem with pg_restore?

From
Greg Stark
Date:
On Thu, Jul 23, 2009 at 3:14 PM, Sam Mason<sam@samason.me.uk> wrote:
> On Thu, Jul 23, 2009 at 07:40:18AM -0600, Scott Marlowe wrote:
>> On Tue, Jul 14, 2009 at 5:47 PM, Jim Michaels<jmichae3@yahoo.com> wrote:
>> > could somebody rewrite pg_dumpall and pg_dump so that it makes editable
>> > dumps?
>> > most programmer's text editors can't handle more than 2000
>> > characters per line. and I want to be able to edit my dumps.

You need to get yourself a better editor.

>> When I need to make changes to large dumps I use tools like sed, awk
>> and diff, not a text editor.
>
> Indeed, but I still like to be able to use a text editor to verify that
> my code is doing the right thing.  Obviously for large files (i.e. a GB
> and over) it's not going to work, but I'd still expect tools to work
> ("less -n" seems to be my tool of choice at the moment).

Actually traditionally tools like sed, awk, etc had fixed-size line
buffers. If your system has a BSD-derived set of tools you may or may
not run into problems depending on whether they've been reimplemented
since. One of the main distinguishing features of the GNU tools was
specifically that they had a policy of choosing implementations that
removed arbitrary limits even if it meant less efficient
implementations.

--
greg
http://mit.edu/~gsstark/resume.pdf