offer alternative scheme to generate table aliases

This patch offers a solution for https://code.launchpad.net/~initos.com/openobject-server/trunk-bug-1314037 
If the alias grows longer than the 63 characters allowed in PostgreSQL by default, it generates an alias based on a hash.