No you can't. But you can deploy the PostgreSQL executable along your app executable, and run it as a "sidecar" process, using a Unix-domain socket to let your app communicate with the PostgreSQL server, and setup PostgreSQL to store the database files in a location specific to your app, instead of a system global location. It's a bit unusual, but it's possible, and PostgreSQL command line makes this relatively easy.
As far as I know, there is no way to link PostgreSQL as a library in another executable. At least, nothing supported by the official PostgreSQL project. Even MySQL, which used to be available as an embedded library, got rid of this, feature a long time ago. Do you have any link to this "underdocumented" feature?
Comments
Can you deploy Postgres by simply linking it into your executable?
No you can't. But you can deploy the PostgreSQL executable along your app executable, and run it as a "sidecar" process, using a Unix-domain socket to let your app communicate with the PostgreSQL server, and setup PostgreSQL to store the database files in a location specific to your app, instead of a system global location. It's a bit unusual, but it's possible, and PostgreSQL command line makes this relatively easy.
Yes, though it's a less common configuration and so a bit fiddly and underdocumented.
As far as I know, there is no way to link PostgreSQL as a library in another executable. At least, nothing supported by the official PostgreSQL project. Even MySQL, which used to be available as an embedded library, got rid of this, feature a long time ago. Do you have any link to this "underdocumented" feature?