From: | paladine <yasinmalli(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: pg_dump-restore concurrency |
Date: | 2010-07-21 12:21:04 |
Message-ID: | 29225050.post@talk.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I have a linux daemon that parses some datas and writes to db continuously
but my db is growing unexpectedly so I must reduce disk space once a week.
vacuum full is one solution but pg_dump-restore gives back more space to OS.
I wrote a script like this
# pg_dump db > asd.sql (1)
# dropdb db (2)
# createdb db (3)
# psql -f asd.sql -d db (4)
PostgreSQL doc says that pg_dump doesn't lock any table but I didn't find
information about restoring dump file. My question is that while db was
processing (4) line, can my daemon continue its normal job (inserting data)
Craig Ringer wrote:
>
> On 21/07/10 19:26, paladine wrote:
>>
>> Hi all
>> I prefer doing pg_dump - psql restore to vacuum full and
>> is there anyone know whether postgresql can insert data concurrently
>> while
>> restoring a table for not losing any data.
>
> There's no particular reason why you can't just feed a data-only dump
> into psql. It should copy all that data into the table without affecting
> new inserts.
>
> If you're doing anything more complex, messing with many tables at once
> etc, then just use the commands built in to PostgreSQL for the purpose.
>
> If you don't like VACUUM FULL for some reason, you should fix your
> autovacuuming so that you don't need it.
>
> See the postgresql documentation and the wiki entries on VACUUM FULL,
> autovacuum, etc.
>
> --
> Craig Ringer
>
> Tech-related writing: http://soapyfrogs.blogspot.com/
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
--
View this message in context: http://old.nabble.com/pg_dump-restore-concurrency-tp29224477p29225050.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Geoffrey | 2010-07-21 13:01:19 | locating cities within a radius of another |
Previous Message | Craig Ringer | 2010-07-21 12:02:21 | Re: pg_dump-restore concurrency |