Joao Miguel Ferreira <joao(dot)mc(dot)ferreira(at)criticalsoftware(dot)com> writes:
> This is what I do:
> system("su postgres -c \"pg_dumpall --clean > some_file\"");
This is going to try to find pg_dumpall in whatever PATH is currently
active within the script --- maybe there's something bogus about that
path? Personally I'd use "su - postgres".
regards, tom lane