Postgresql Execute Function With Restricted Domain