According to this link, to perform something parallel in postgresql extension, multi-thread isn't an option.

So is there any other method? Such as some API and usage about multi-process? Maybe let me konw where can I find any example code?

Or the expection itself of performing something parallel in Postgresql extension does not reasonable at all? Would you provide some explanation?

Updated: Regarding the things I want to parallelize, it generally has nothing with Postgresql, but caculate hash of a bunch of data

  • If your extension declares functions, then just declaring them to be parallel safe (assuming they are) would allow PostgreSQL to parallelize them automatically. If it does something else, we would need to know what that something else is.
    – jjanes
    Sep 21, 2023 at 15:31

1 Answer 1


One thing you could do is to write a custom background worker process that starts additional helper processes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.