Обсуждение: backup/restore APIs

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

backup/restore APIs

От
Sean Song
Дата:
Hi,
 
I want to do backup/restore Postgresql database from my program, but I don't want to rely on pg_dump/pg_restore or psql front end tools. Is there backup/restore functions in the interface libs for this purpose?
 
Thanks,
 
 
pcsps


Yahoo! FareChase - Search multiple travel sites in one click.

Re: backup/restore APIs

От
David Stanaway
Дата:
If your schema is static (Never a safe assumption) you can use the
"COPY ... TO ..." SQL using your preferred client library.

If you want to keep the state of sequences, and changes to the schema
etc, you might be better off using pg_dump. If you want to use that in
your app, it probably wouldn't be too hard to link in the code from
pg_dump. Keep in mind though, that probably has version dependent code
in it as it looks at the system tables, and may be subject to change.

On Fri, 2005-10-28 at 06:57 -0700, Sean Song wrote:
> Hi,
>  
> I want to do backup/restore Postgresql database from my program, but I
> don't want to rely on pg_dump/pg_restore or psql front end tools. Is
> there backup/restore functions in the interface libs for this purpose?
>  
> Thanks,
>  
>  
> pcsps
> 
> ______________________________________________________________________
> Yahoo! FareChase - Search multiple travel sites in one click. 



Re: backup/restore APIs

От
Peter Eisentraut
Дата:
Am Freitag, 28. Oktober 2005 15:57 schrieb Sean Song:
> I want to do backup/restore Postgresql database from my program, but I
> don't want to rely on pg_dump/pg_restore or psql front end tools. Is there
> backup/restore functions in the interface libs for this purpose?

No.