You can group Postgresql binaries into your application, but not incorporate them into the same process. You will need to invoke initdb, pg_ctl, etc. in your application and manage postgres startup and shutdown.
It works well, but it can’t be complicated.
Do not use standard port 5432 or send the official postgres installer and run it in silent mode. This confuses users a lot when they wonder where "postgres" came from and they informed about the mailing lists about our "adware" or "stealth installation" or whatever. Instead, group the binaries of . zip, the pre-compiled installation tree, or whatever. And don’t run on port 5432.
Remember to include the MSVC runtime for the postgres binaries you’re using, if they need a different one for your app.
There is much advice on how to do this in more detail.
See if it’s not worth doing a UWP project instead of Winforms.
– Thiago Lunardi
Hello @Thiagolunardi, thanks for the tip. I have to ensure compatibility with at least Windows XP. Reason: Many small business customers who don’t want to trade their hardware.
– Edvaldo Silva