Обсуждение: pg_dump problems
Hi everyone, I'm having problems using pg_dump. When I run the command pg_dump -a -d testrig > testrig.data on a machine running postgresql 7.4.13 with database testirg i have no problem. Then, I want to do the same but on a different machine running postgresql 7.4.6 with database root. So... pg_dump -a -d root > root.data For some reason this doesnt work! The command is running without error, but the file root.data is always empty. The database does exist and all the data is there, and I can run psql and do everything I normally do. I've tried pg_dump with other databases and still get an empty file. Could it be the commands are different for the different versions? If thats the case, does anyone know what command I should be running? -- View this message in context: http://www.nabble.com/pg_dump-problems-tf2912789.html#a8138723 Sent from the PostgreSQL - general mailing list archive at Nabble.com.
JTyrrell wrote: > > pg_dump -a -d testrig > testrig.data > > on a machine running postgresql 7.4.13 with database testirg i have no > problem. > > Then, I want to do the same but on a different machine running postgresql > 7.4.6 with database root. So... > > pg_dump -a -d root > root.data > > For some reason this doesnt work! The command is running without error, but > the file root.data is always empty. The database does exist and all the data > is there, and I can run psql and do everything I normally do. I've tried > pg_dump with other databases and still get an empty file. Should work just fine. 1. Does "pg_dump -s" work? 2. Does the user you run this as have permission to dump data from "root"? -- Richard Huxton Archonet Ltd
Richard Huxton wrote: > > JTyrrell wrote: >> >> pg_dump -a -d testrig > testrig.data >> >> on a machine running postgresql 7.4.13 with database testirg i have no >> problem. >> >> Then, I want to do the same but on a different machine running postgresql >> 7.4.6 with database root. So... >> >> pg_dump -a -d root > root.data >> >> For some reason this doesnt work! The command is running without error, >> but >> the file root.data is always empty. The database does exist and all the >> data >> is there, and I can run psql and do everything I normally do. I've tried >> pg_dump with other databases and still get an empty file. > > Should work just fine. > 1. Does "pg_dump -s" work? > 2. Does the user you run this as have permission to dump data from "root"? > > -- > Richard Huxton > Archonet Ltd > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > > 1. pg_dump -s doesn't work. I've tried using a load of other options and none at all but no luck. 2. I'm running as root so wont be a problem there, and the file im dumping to has full permissions for everyone. What makes this even more confusing is I tried pg_dump with a database name that doesnt exist and tried dumping from database root with a user that doesn't have permission to do that. Both gave the same results as before. Its basically creating the file i need, looking for the database and not finding it. When you dump an empty database the file at least has some info on session authorization and the schema. Im getting nothing! -- View this message in context: http://www.nabble.com/pg_dump-problems-tf2912789.html#a8156139 Sent from the PostgreSQL - general mailing list archive at Nabble.com.
JTyrrell <jtyrrell_@hotmail.com> writes: > 1. pg_dump -s doesn't work. I've tried using a load of other options and > none at all but no luck. > 2. I'm running as root so wont be a problem there, and the file im dumping > to has full permissions for everyone. > What makes this even more confusing is I tried pg_dump with a database name > that doesnt exist and tried dumping from database root with a user that > doesn't have permission to do that. Both gave the same results as before. > Its basically creating the file i need, looking for the database and not > finding it. When you dump an empty database the file at least has some info > on session authorization and the schema. Im getting nothing! It's really hard to believe that pg_dump would write nothing to either the output file or stderr. The only thought that comes to mind is that if this machine has SELinux enabled, the SELinux policy might be forbidding it from writing on the output file. What's the platform, exactly? regards, tom lane
Im using Red Hat Enterprise Linux 4. Thing is it worked before christmas but doesn't now. I've just moved the data across by hand so its not too much of a problem anymore. Might need to use dump again though so would be nice to get the problem fixed Tom Lane-2 wrote: > > JTyrrell <jtyrrell_@hotmail.com> writes: >> 1. pg_dump -s doesn't work. I've tried using a load of other options and >> none at all but no luck. > >> 2. I'm running as root so wont be a problem there, and the file im >> dumping >> to has full permissions for everyone. > >> What makes this even more confusing is I tried pg_dump with a database >> name >> that doesnt exist and tried dumping from database root with a user that >> doesn't have permission to do that. Both gave the same results as before. >> Its basically creating the file i need, looking for the database and not >> finding it. When you dump an empty database the file at least has some >> info >> on session authorization and the schema. Im getting nothing! > > It's really hard to believe that pg_dump would write nothing to either > the output file or stderr. The only thought that comes to mind is that > if this machine has SELinux enabled, the SELinux policy might be > forbidding it from writing on the output file. What's the platform, > exactly? > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org/ > > -- View this message in context: http://www.nabble.com/pg_dump-problems-tf2912789.html#a8175027 Sent from the PostgreSQL - general mailing list archive at Nabble.com.