Can Postgres Trigger Return A Value In Python How To Sort