Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use postgresql without starting a server (perhaps as a library)?

I would like to use some features of postgresql, specifically crosstab/pivot on my dataset. Databases, such as pgsql, handle large crosstabs much better than memory only tools such as Python's pandas. However, I don't want to install and manage the pgsql server.

Is there a way to use the query engine of pgsql as a python (or other language) library?

Here is an example of monetdb distribution (called monetdb-lite) which can be used as a python library: https://www.monetdb.org/blog/monetdblite-for-python

like image 266
Shahbaz Avatar asked Mar 06 '23 05:03

Shahbaz


1 Answers

PostgreSQL cannot be used as an embedded database in the way you would like.

There has been a lengthy thread on the pgsql-hackers mailing list about starting PostgreSQL in standalone mode for use as an embedded database, but the problems were just too bad, and too many necessary things cannot be made to work properly (e.g. autovacuum or checkpoints).

Use a different RDBMS.

like image 166
Laurenz Albe Avatar answered Mar 22 '23 20:03

Laurenz Albe