Why do you want that at the database level?
Do you have end-to-end scenario that benefits from using Lucee?
>I was wondering how difficult it would be to implement a Postgres extension that will act as a wrapper around it and will allow to write functions in that language?
Have you checked PL/Java?
Vladimir