Joao Miguel Ferreira <joao.mc.ferreira@criticalsoftware.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