vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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@postgresql.org so that your message can get through to the mailing list cleanly |
| |||
| 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) |
| |||
| 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 |
| |||
| > > > 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 |
| |||
| 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.postgresql.org |
| |||
| 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.nosoftwarepatents.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFHRu4yHQIGEs7eeARA/jnAJ96zI01MNyo3ySb5nxRQHsvEgSMPwCeMLy/ Hth7QMFWdONd+hoqUt76hRE= =J/H2 -----END PGP SIGNATURE----- |
| |||
| > 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 |
| |||
| 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 |
| |||
| 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. |
| ||||
| 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 |