Обсуждение: Cannot restart postgres

Поиск
Список
Период
Сортировка

Cannot restart postgres

От
elein
Дата:
7.x installation.  (Yeah, yeah, upgrade.)

I have a disk which has only the database on it.
It has become full and postgres won't start.

Is there an option (besides restore from backup)
other than trying to move the data dir to a bigger
disk?

Would pg_resetxlog do the right thing to free up
some space so I can go in and vacuum and delete rows?

This is somewhat urgent.

Thanks for your help.

--elein
elein@varlena.com

Re: Cannot restart postgres

От
Casey Duncan
Дата:
Are there any other partitions on that machine with space available?
If so you could move some files there from your postgres data dir and
symlink to them from their original location. At least then you might
get it to start so you can get a pg_dump to work.

-Casey

On Jun 19, 2006, at 1:43 PM, elein wrote:

> 7.x installation.  (Yeah, yeah, upgrade.)
>
> I have a disk which has only the database on it.
> It has become full and postgres won't start.
>
> Is there an option (besides restore from backup)
> other than trying to move the data dir to a bigger
> disk?
>
> Would pg_resetxlog do the right thing to free up
> some space so I can go in and vacuum and delete rows?
>
> This is somewhat urgent.
>
> Thanks for your help.
>
> --elein
> elein@varlena.com
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings


Re: Cannot restart postgres

От
Scott Marlowe
Дата:
On Mon, 2006-06-19 at 17:45, Casey Duncan wrote:
> Are there any other partitions on that machine with space available?
> If so you could move some files there from your postgres data dir and
> symlink to them from their original location. At least then you might
> get it to start so you can get a pg_dump to work.

Also, if you're on linux on an ext2/3 partition, try this, as root:

tune2fs -m 0 /dev/hdxn

where x is the drive
and n is the partition number of the drive you have your postgresql
partition on.

Set it back after your done to have your safety net once again.

Re: Cannot restart postgres

От
Tom Lane
Дата:
elein <elein@varlena.com> writes:
> 7.x installation.  (Yeah, yeah, upgrade.)
> I have a disk which has only the database on it.
> It has become full and postgres won't start.

> Is there an option (besides restore from backup)
> other than trying to move the data dir to a bigger
> disk?

I'd try to remove some old xlog segments manually, rather than relying
on pg_resetxlog's scorched-earth approach.  Assuming your PG is new
enough to have the pg_controldata program, run that and look at the last
checkpoint REDO location.  Anywhere that's not between there and WAL tip
is removable.  (If you're not sure about WAL tip, the WAL file with the
newest mtime is probably it.)

If you screw up, you can always fall back to pg_resetxlog, but that
shouldn't be your first resort because of the risk of having
inconsistent data afterwards.

            regards, tom lane