can i use postgresql in android phone? can i use postgresql in android phone? postgresql postgresql

can i use postgresql in android phone?


PostgreSQL is now available for Termux on Andriod

Install Termux from the Play Store and run it.

To install PostgreSQL:

$ pkg install postgresql

To start it first create your folder you want to store the data in and then init te folder:

$ mkdir -p $PREFIX/var/lib/postgresql$ initdb $PREFIX/var/lib/postgresql

To start the server:

$ pg_ctl -D $PREFIX/var/lib/postgresql start

To stop the server:

$ pg_ctl -D $PREFIX/var/lib/postgresql stop

Create a user to allow you to connect form an App:

$ createuser --superuser --pwprompt yourUserName

Create your database:

$ createdb mydb

Open your database

$ psql mydb

You will now see the promt:

mydb=#

PostgreSQL is up and running now.


Apparently, now you can, using Termux (a terminal emulator and Linux environment for Android and Chromebook).


There is no PostgreSQL port for Android.

PostgreSQL cannot be compiled for Android. And it really would make very little sense: PostgreSQL is particularly suited to large databases and multi-user access. Also, it is unlikely that you need PostGIS's functionality on an Android device. There are multiple database / spatial data apps out there; or develop your own from available toolkits.