I am using call method to load sql dump:
call(["psql", "-U", "user", "name", "<", "pathtofile"])
This is directly logging into postgres and ignoring "<" and pathtofile.
psql: warning: extra command-line argument "<" ignored
Try changing to this:
call(["psql", "-U", "user", "name", "<", "pathtofile"], shell=True)
^^^^^^^^^^^^
"<" is an input redirection operator, and must be interpreted by a shell. If you don't say shell=True, it's passed to psql as an argument, and psql has no idea what to do with it.
Edit: in general, what @falsetru suggested is a better approach, because passing arbitrary strings to shells can be dangerous. But if you need to use shell operations, shell=True is the way to do it.