Re: Problem with backing up a large database

From: Mael Rimbault <mael(dot)rimbault(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>, Athanasios Kostopoulos <athanasios(dot)kostopoulos(at)classmarkets(dot)com>, Luca Ferrari <fluca1978(at)infinito(dot)it>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Problem with backing up a large database
Date: 2013-08-20 17:47:03
Message-ID: CAEKp92zuW_J3=XHWV3V3hoGm-HVGeav==ZPULbo5r8tFsWh5YA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi all,

2013/8/20 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>
> I think it would be '[^z]*'. The basic notation is not regex, it's
> like Unix shells' filename wildcards; so you *do* need a star.
> But we do recognize regex-style character classes, else this
> requirement couldn't be met at all.
>

Agreed that the notation is not regex, and that the star is required,
but '[^z]*' does not seem to address Athanasios need to me :

$ pg_dump -s -T '[^z]*' pgbench | grep "^CREATE TABLE" | cut -d" " -f3
ztest

--> revert the "table name begins with a z" condition, and thus
excludes everything except for the "ztest" table.
--> same behaviour that : pg_dump -t 'z*'

$ pg_dump -s -T '^z*' pgbench | grep "^CREATE TABLE" | cut -d" " -f3
pgbench_accounts
pgbench_branches
pgbench_history
pgbench_tellers

--> excludes tables using "table name begins with a z" condition, and
thus do what Athanasios was expecting.
--> for that matter, the "^" does not seem to be necessary, pg_dump -T
'z*' has the same behaviour

But I may have missed your point.

2013/8/20 Athanasios Kostopoulos <athanasios(dot)kostopoulos(at)classmarkets(dot)com>:
>
> pg_dump -h XXX.XXX.XXX.XXX -p XXX -U postgres -T feedimport_log -T
> error_item -T '^z*' -Fc some_large_db
>
> However, my backups are quite large (thus it takes too much time to process
> them) and when I am doing a listing for tables that should not be there, I
> get the following (among others):
>
> 307; 1259 5501792 TABLE feedimport feedimport_log postgres
>
> as well as the whole bunch of tables starting with z that I am trying to
> exclude using the regex.
> Any pointers about what I might be doing wrong and how I can improve the
> backup process?

Strange, from what I can see, this command line should work as you expect.
That may be due to the schema feedimport not beeing in your search_path.

--
Mael

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2013-08-20 19:30:24 Re: Problem with backing up a large database
Previous Message Tom Lane 2013-08-20 13:51:19 Re: Problem with backing up a large database