Thread: Backup of entire servers and roles/tablespaces

Backup of entire servers and roles/tablespaces

From
Dave Page
Date:
I'm just in the process of hacking pgAdmin to allow backup of entire
servers or global info (roles and tablespaces). I was using the same
mechanism as we use for pg_dump, however this doesn't work with
pg_dumpall which doesn't support the -f option to redirect output to a file.

Instead, I've been looking at separating the output and error streams
from pg_dumpall, however this won't work either because pg_dumpall calls
pg_dump to do much of it's work, and we cannot attach to those streams
through pg_dumpall.

I'm therefore toying with writing our own backup code to act as an
equivalent to pg_dumpall, but would really prefer not to do this as the
backup code is extremely important to get right of course.

Thoughts or ideas?

Regards, Dave.

Re: Backup of entire servers and

From
Devrim GUNDUZ
Date:
Hi,
On Fri, 2007-01-05 at 16:47 +0000, Dave Page wrote:

> Thoughts or ideas?

Isn't it a better solution to add -f to pg_dumpall?

Regards,
--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/




Attachment

Re: Backup of entire servers and roles/tablespaces

From
"Hiroshi Saito"
Date:
Hi.

> I'm just in the process of hacking pgAdmin to allow backup of entire
> servers or global info (roles and tablespaces). I was using the same
> mechanism as we use for pg_dump, however this doesn't work with
> pg_dumpall which doesn't support the -f option to redirect output to a file.
>
> Instead, I've been looking at separating the output and error streams
> from pg_dumpall, however this won't work either because pg_dumpall calls
> pg_dump to do much of it's work, and we cannot attach to those streams
> through pg_dumpall.
>
> I'm therefore toying with writing our own backup code to act as an
> equivalent to pg_dumpall, but would really prefer not to do this as the
> backup code is extremely important to get right of course.
>
> Thoughts or ideas?

Yea, I think so. however, surely the importance exists for a user.
I know that it has many problems with pgpass.conf....
Although only a specific user may be able to save, pgAdmin3 does
not have preparations in it. probably, it is desirable.

Regards,
Hiroshi Saito




Re: Backup of entire servers and

From
Guillaume Lelarge
Date:
Devrim GUNDUZ a ecrit le 05/01/2007 17:55:
> Hi,
> On Fri, 2007-01-05 at 16:47 +0000, Dave Page wrote:
>
>> Thoughts or ideas?
>
> Isn't it a better solution to add -f to pg_dumpall?
>

Adding -f to pg_dumpall will only made it available for 8.3, isn't it ?
or we will have to handle our own pg_dumpall source code with this new
option. It seems a bit hard to me.


--
Guillaume.

Re: Backup of entire servers and

From
Dave Page
Date:
Guillaume Lelarge wrote:
> Devrim GUNDUZ a ecrit le 05/01/2007 17:55:
>> Hi,
>> On Fri, 2007-01-05 at 16:47 +0000, Dave Page wrote:
>>
>>> Thoughts or ideas?
>>
>> Isn't it a better solution to add -f to pg_dumpall?
>>
>
> Adding -f to pg_dumpall will only made it available for 8.3, isn't it ?
> or we will have to handle our own pg_dumpall source code with this new
> option. It seems a bit hard to me.

Well, this code won't be released until 8.3 is anyway...

I imagine it's not there already because when passed to pg_dump, the
file will get overwritten every time. We'd need to add an append option
to pg_dump as well. which seems a bit ugly. At first thought I figured
there was more to it than that, but maybe not. I'll raise it on
pgsql-hackers and see what objections are raised.

Cheers, Dave.

Re: Backup of entire servers and

From
Devrim GUNDUZ
Date:
Hi,

On Fri, 2007-01-05 at 18:10 +0100, Guillaume Lelarge wrote:
> > Isn't it a better solution to add -f to pg_dumpall?
> >
>
> Adding -f to pg_dumpall will only made it available for 8.3, isn't
> it ?

Yes. But this will fix the source of the problem. Then pgadmin will say
"I can dumpall to a file with PostgreSQL 8.3" That's all.

Resolving this issue in pgadmin is the bad way, I think.

Regards,
--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/




Attachment