is there any option like with encryption prent in MS SQL
The TODO page in the Postgres Wiki suggests one "workaround":
Originally Posted by Postgres Wiki
Obfuscated function source code (not wanted)
Obfuscating function source code has minimal protective benefits because anyone with super-user access can find a way to view the code. At the same time, it would greatly complicate backups and other administrative tasks. To prevent non-super-users from viewing function source code, remove SELECT permission on pg_proc.