Is it possible to delete a blog from the "I read these blogs" list?
Backup and restore through JDBC
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > PostgreSQL database development > Backup and restore through JDBC 19 August 2008 14:35:25

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Backup and restore through JDBC

Marlon Petry 19 August 2008 14:35:25
 Hello List
I am trying to develop, a API to carry through backup and restore through
JDBC.
I think that the best form is to use JNI.
Some Suggestion?
Add comment
Albe Laurenz 29 September 2006 11:11:38 permanent link ]
 Marlon Petry wrote:> I am trying to develop, a API to carry through backup and > restore through JDBC.> I think that the best form is to use JNI. > Some Suggestion?

Do you mean 'backup' or 'export/dump'?
If you mean 'export', do you need anything besides SQL?
If you mean 'backup', how do you want to restore from
a client machine when there is no server running?
And if you're on the server, why would you want to use Java?

Yours,
Laurenz Albe

-------------------­--------(end of broadcast)---------­------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresq­l.org so that your
message can get through to the mailing list cleanly

Add comment
Marlon Petry 29 September 2006 16:10:50 permanent link ]
 The idea is to make one pg_dump of the server and to keep in the machine of
client.
And to restore this pg_dump when it will be necessary through the machine of
the client.
Perhaps I will have that to use some store procedure in the server, I do not
know


regards
Marlon



2006/9/29, Albe Laurenz < all@adv.magwien.gv.­at>:>
Marlon Petry wrote:> > I am trying to develop, a API to carry through backup and> > restore through JDBC.> > I think that the best form is to use JNI.> > Some Suggestion?>
Do you mean 'backup' or 'export/dump'?> If you mean 'export', do you need anything besides SQL?> If you mean 'backup', how do you want to restore from> a client machine when there is no server running?> And if you're on the server, why would you want to use Java?>
Yours,> Laurenz Albe>



--
Marlon

"A busca infinita Ю felicidade nos priva de vivЙ-la a cada dia..." (Elba
Lucas)
Add comment
Andrew Dunstan 29 September 2006 16:29:37 permanent link ]
 Marlon Petry wrote:>
The idea is to make one pg_dump of the server and to keep in the > machine of client.> And to restore this pg_dump when it will be necessary through the > machine of the client.> Perhaps I will have that to use some store procedure in the server, I > do not know>

pg_dump and pg_restore do not need to run on the server machine. Why not
just run them where you want the dump stored?

cheers

andrew

-------------------­--------(end of broadcast)---------­------------------
TIP 5: don't forget to increase your free space map settings

Add comment
Marlon Petry 29 September 2006 16:45:22 permanent link ]
 

The idea is to make one pg_dump of the server and to keep in the> > machine of client.> > And to restore this pg_dump when it will be necessary through the> > machine of the client.> > Perhaps I will have that to use some store procedure in the server, I> > do not know> >
pg_dump and pg_restore do not need to run on the server machine. Why not> just run them where you want the dump stored?>
cheers>
andrew>


But I would need to have installed pg_dump and pg_restore in machine client?
Without having installed pg_dump and pg_restore,how I could make

regards,Marlon
Add comment
Andrew Dunstan 29 September 2006 16:55:13 permanent link ]
 Marlon Petry wrote:>
pg_dump and pg_restore do not need to run on the server machine.> Why not> just run them where you want the dump stored?>
But I would need to have installed pg_dump and pg_restore in machine > client?> Without having installed pg_dump and pg_restore,how I could make>


You can't. pg_dump in particular embodies an enormous amount of
knowledge that simply does not exist elsewhere. There is no dump/restore
API, and there is nothing you can hook up to using JNI, AFAIK.

cheers

andrew


-------------------­--------(end of broadcast)---------­------------------
TIP 4: Have you searched our list archives?

http://archives.pos­tgresql.org

Add comment
Andreas Pflug 29 September 2006 16:59:25 permanent link ]
 Andrew Dunstan wrote:> Marlon Petry wrote:>>
pg_dump and pg_restore do not need to run on the server machine.>> Why not>> just run them where you want the dump stored?>>
But I would need to have installed pg_dump and pg_restore in machine>> client?>> Without having installed pg_dump and pg_restore,how I could make>>
You can't. pg_dump in particular embodies an enormous amount of> knowledge that simply does not exist elsewhere. There is no> dump/restore API, and there is nothing you can hook up to using JNI,> AFAIK.
Recently, there was the proposal to extract that knowledge to a library
(making pg_dump itself just a wrapper). This sounds valuable more and
more, is anybody working on this for 8.3?

Regards,
Andreas


-------------------­--------(end of broadcast)---------­------------------
TIP 2: Don't 'kill -9' the postmaster

Add comment
Markus Schaber 29 September 2006 17:12:24 permanent link ]
 Hi, Marlon,

Marlon Petry wrote:
But I would need to have installed pg_dump and pg_restore in machine> client?> Without having installed pg_dump and pg_restore,how I could make

pg_dump and pg_restore should be runnable (possible with a small shell /
bash wrapper script) without any "installation", simply having them and
all neded libs lying in the current directory. They don't need any
registry keys, weird environment settings or such, just some libs which
should be present on most platforms, except libpq.

Using a java application for dump/restore will burden you with
installing a JVM, the PostgreSQL JDBC drivers, and your application,
which seems at least equal effort and more ressources.


Btw, another idea is to run pg_dump on the server, but pipe its output
to the client, e. G. via running it through telnet or SSH (yes there are
SSH servers for windows), and then piping it to a file on the client (e.
G. using plink.exe from the putty package). Or use netcat or so.

On a unix box, when you're really crazy, and want to ignore all security
restrictions, you could even install pg_dump via inetd, and then
everyone connecting via TCP on the appropriate port gets a dump of the
database. :-)­

HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepaten­ts.org


Add comment
Marlon Petry 29 September 2006 17:13:12 permanent link ]
 
Marlon Petry wrote:> >>
pg_dump and pg_restore do not need to run on the server machine.> >> Why not> >> just run them where you want the dump stored?> >>
But I would need to have installed pg_dump and pg_restore in machine> >> client?> >> Without having installed pg_dump and pg_restore,how I could make> >>
You can't. pg_dump in particular embodies an enormous amount of> > knowledge that simply does not exist elsewhere. There is no> > dump/restore API, and there is nothing you can hook up to using JNI,> > AFAIK.> Recently, there was the proposal to extract that knowledge to a library> (making pg_dump itself just a wrapper). This sounds valuable more and> more, is anybody working on this for 8.3?>
Regards,> Andreas>
I have interest in working,how i could start ?

regards,marlon
Add comment
Andrew Dunstan 29 September 2006 17:25:05 permanent link ]
 Marlon Petry wrote:>>
You can't. pg_dump in particular embodies an enormous amount of> > knowledge that simply does not exist elsewhere. There is no> > dump/restore API, and there is nothing you can hook up to using JNI,> > AFAIK.> Recently, there was the proposal to extract that knowledge to a> library> (making pg_dump itself just a wrapper). This sounds valuable more and> more, is anybody working on this for 8.3?>
I have interest in working,how i could start ?>


Start by reading the code in src/bin/pg_dump

Then after you recover from your head exploding you start devising some
sort of sane API ...

cheers

andrew

-------------------­--------(end of broadcast)---------­------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Add comment
Marlon Petry 29 September 2006 17:40:12 permanent link ]
 Marlon Petry wrote:>> >
You can't. pg_dump in particular embodies an enormous amount of> > > knowledge that simply does not exist elsewhere. There is no> > > dump/restore API, and there is nothing you can hook up to using> JNI,> > > AFAIK.> > Recently, there was the proposal to extract that knowledge to a> > library> > (making pg_dump itself just a wrapper). This sounds valuable more> and> > more, is anybody working on this for 8.3?> >
I have interest in working,how i could start ?> >
Start by reading the code in src/bin/pg_dump>
Then after you recover from your head exploding you start devising some> sort of sane API ...>
cheers>
andrew>


ok. i'm trying start.
Add comment
Tom Dunstan 29 September 2006 18:00:43 permanent link ]
 Markus Schaber wrote:> Marlon Petry wrote:>> But I would need to have installed pg_dump and pg_restore in machine>> client?>> Without having installed pg_dump and pg_restore,how I could make>
pg_dump and pg_restore should be runnable (possible with a small shell /> bash wrapper script) without any "installation", simply having them and> all neded libs lying in the current directory.

There's probably a case for having static builds of pg_dump and
pg_restore around for various architectures, if only to help people out
when they don't have access to a build environment etc. Either a set of
static binaries on the website, or an easy way to build them from the
source tree (they could then be copied to the target system).

It strikes me that Marlon hasn't really explained why he wants to use
JDBC. I assume that your application is Java based, but trust me,
invoking pg_dump through Runtime.exec() or whatever is going to be much,
much easier than any of the other things you've suggested, such as
making a pg_dump API and using JNI to call it. That's just pain city, in
a bunch of ways.

Do you need to process the dump inside your program in some way? Or do
you just need to store a dump and restore it later? Why the fascination
with using an API?
On a unix box, when you're really crazy, and want to ignore all security> restrictions, you could even install pg_dump via inetd, and then> everyone connecting via TCP on the appropriate port gets a dump of the> database. :-)­

Oh, man, my head just exploded reading that. That's taking evil and
being *creative* with it. :)­

Cheers

Tom


-------------------­--------(end of broadcast)---------­------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Add comment
Tom Lane 29 September 2006 19:19:09 permanent link ]
 Andrew Dunstan <andrew@dunslane.ne­t> writes:> Then after you recover from your head exploding you start devising some > sort of sane API ...

That's the hard part. There is no percentage in having a library if
it doesn't do anything significantly different from what you could
accomplish via
system("pg_dump ...switches....");

What is it you hope to accomplish by having a library, exactly?
(And don't say "more control over the dump process". pg_dump is already
on the hairy edge of maintainability; we do *not* need to try to deal
with making it still function correctly after an application programmer
makes some random intervention in the process.)

regards, tom lane

-------------------­--------(end of broadcast)---------­------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Add comment
Andreas Pflug 29 September 2006 20:49:17 permanent link ]
 Tom Lane wrote:> Andrew Dunstan <andrew@dunslane.ne­t> writes:>
Then after you recover from your head exploding you start devising some >> sort of sane API ...>>
That's the hard part. There is no percentage in having a library if> it doesn't do anything significantly different from what you could> accomplish via> system("pg_dump ...switches....");>­
What is it you hope to accomplish by having a library, exactly?> (And don't say "more control over the dump process".
Some more progress feedback would be really nice.> pg_dump is already> on the hairy edge of maintainability; we do *not* need to try to deal> with making it still function correctly after an application programmer> makes some random intervention in the process.)>
Agreed. The only sane approach seems to have a single dump function call
(that takes a set of parameters as prepared by command line scanning)
and a set of callbacks that enable api users to do sensible stuff at
different stages of the backup process.

Regards,
Andreas





-------------------­--------(end of broadcast)---------­------------------
TIP 5: don't forget to increase your free space map settings

Add comment
Markus Schaber 30 September 2006 14:25:25 permanent link ]
 Hi, Tom,

Tom Dunstan wrote:
On a unix box, when you're really crazy, and want to ignore all security>> restrictions, you could even install pg_dump via inetd, and then>> everyone connecting via TCP on the appropriate port gets a dump of the>> database. :-)­>
Oh, man, my head just exploded reading that. That's taking evil and> being *creative* with it. :)­

Well, combine that with some firewall / hosts.allow rules, and sslwrap
with certificate based 2-way authentication, if you "insist" on
security. :-)­

Keep on lauging,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepaten­ts.org

Add comment
Guest 19 August 2008 14:35:25 permanent link ]
 I didnt get anything al last.
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > PostgreSQL database development > Backup and restore through JDBC 19 August 2008 14:35:25

see also:
TODO: Add a GUC to control whether…
Re: Re: [GENERAL] ??: [GENERA
[JBoss Seam] - Re: bookmarkable page…
пройди тесты:
see also:
((
Nyuu
Borland C++ Builder 6.0

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .