- A PostgreSQL trigger that moves a file on the filesystem
- CREATE OR REPLACE FUNCTION move_file(old_path text, new_path text)
- RETURNS boolean AS
- $$
- import shutil
- try:
- shutil.move(old_path, new_path)
- return True
- except:
- return False
- $$
- LANGUAGE 'plpythonu' VOLATILE;