Re: pg_dump fundenental question

From: "Christofer C(dot) Bell" <christofer(dot)c(dot)bell(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump fundenental question
Date: 2016-07-05 22:13:40
Message-ID: CAOEVnYvzwn57XDHcbjft059XT297YdkOs1YfV1v9excVyqviaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 5, 2016 at 3:17 PM, Paul Linehan <linehanp(at)tcd(dot)ie> wrote:

> > a good point, but I would prefer NOT to open a 324GB backup file in a
> text
> > editor. I can however cat/less/head/tail the file in Linux.
>
> Use vi (or flavour thereof) - it doesn't load the entire file in order to
> read the contents of lines 1 - 100 (say).
>

What Paul says is very true, but if you are doing this, do be cognizant of
where your fingers are. If you press any key that will put vi into edit
mode, it will then make a copy of the file for backup purposes. Your 324GB
file will become 648GB of disk usage and you'll have to wait while the
backup copy is written out to disk. It will not load the whole file into
memory (ever) nor will it make a copy of the file as long as you stay in
command mode.

If you want to use vi or equivalent for viewing the file without any danger
of accidentally putting the editor into edit mode (and thus triggering the
backup copy), you may want to invoke vi as "view(1)". This opens vi
read-only and you'll be able to use vi style hotkeys for navigation.

> Paul...
>

Chris

"If you wish to make an apple pie from scratch, you must first invent the
Universe." -- Carl Sagan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message trafdev 2016-07-05 22:21:06 Re: pg_dump fundenental question
Previous Message Tom Lane 2016-07-05 21:37:11 Re: Possible to create canonicalized range type without being superuser?