Can you try and provide Postgresql package for Termux.I know the Postgresql requires a new user but can you try to get it into termux???
I'll post here if there is any progress in building it - @vishalbiswas has been doing some work here.
Is there way to use postgresql but not be new user?
Like after changing the source code..
I don't think so. Changing Postgresql source to not create a new user will most likely change it administration and authorisation system
A postgresql package, containing both the database server and the psql client, has been created by @vishalbiswas and is now available:
packages install postgresql
(run apt update && apt upgrade if you do not have the packages command available yet)
There is also a postgresql-contrib package available, currently containing the following extensions:
There is a tiny little piece missing in all of this. After one installs the package and tries to launch psql
could not connect to server: No such file or directory
Is the server running locally and accpeting connections on Unix domain socket "/data/data/com.termux/files/usr/tmp//.s.PGSQL.5432"
I have seen wispers about a 3003 group which needs to be created, but nobody actually spells anything out. Why doesn't the package create the group and put the postgres user in it?
@RolandHughes you need to manually create the initial database and start the server.
initdb ~/pg
pgctl -D ~/pg start
Then you can connect with psql.
Creating users and groups requires root privileges.
@vishalbiswas
initdb ~/pg
pgctl -D ~/pg start
which one is the db name? is that pg you mentioned here DB?
@annaduraiviki
Neither. Don't think in PC terms.PostgreSQL is a real database which came down from real computers. Not a wanna-be database coming up from wanna-be computers.
initdb ~/pg
That line initializes a directory path with various files the server will use, including a "default" database, but does not name a database.
pgctl -D ~/pg start
Starts the daemon/server and tells it what directory path to use.
You have to physically create the database you wish to use. You can create any number of them limited only by storage space on that device.
This is an incredibly stripped down version of Ingress, at least as I remember. On real platforms we had one server instance with hundreds of paths strewn across many hundreds of disks. We had to. Those 14 inch disks only had 456 Meg of storage capacity back then.
On a standard Linux system (in this case KDE Neon) you need to do the following:
roland@roland-HP-Compaq-8100-Elite-SFF-PC:~$ psql postgres
psql (9.5.7)
Type "help" for help.
postgres=# help
You are using psql, the command-line interface to PostgreSQL.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=# \? createdb
That will get you the help on all of the things you can do when creating a database.
Postgresql is working. php7 module working. But pgsql.so does not load though it exists. pg_connect thrown out as undefined. Tried all possible php.ini extensions but no success. Any suggestions?
@mozzworld pgsql.so loads with php's built-in server but doesn't load with apache
Thank you to all who have made PostgreSQL available under Termux!
Just one request: is there anyway to downgrade to version 9.6? I got caught napping, and discovered too late that the 10.0 update won't mount my existing 9.6 database. I know, I should be doing a dumpall nightly - which I will from here on, but I need to downgrade to v9.6 just long enough to do that dumpall, then I'm happy to go back to v10.0. Thanks!
For reference, here is how to temporarily install 9.6 to dump databases before updating to 10.0:
Install one of the below deb files:
The following command can be used to install the package:
curl -o postgres.deb https://fornwall.net/postgresql_9.6.5_`dpkg --print-architecture`.deb && dpkg -i postgres.deb
Many thank yous! This works perfectly. I was able to downgrade to 9.6, run a dumpall, and re-upgrade to 10 and import all within an hour (probably less).
Just a side note, in case anyone else ever runs into it: I did have to hand-edit a few things in the dumpall file to adust some things that v10 considered to be syntax errors, even though the syntax of the file looked completely normal to me. Specifically, v10 did not apparently like semicolons inside text strings, nor did it understand the N null field indicator. In the end all was well. Curious though, I did not have to make those edits for PostreSQL v10 to read the 9.6 dumpall file on my osx platform. Maybe an android oddity...? :-)
What I can do ? I sorry just start to learn whene I download the termux 😕
msf > db_status
[*] postgresql selected, no connection
I having been trying to connect PHP with Postgres without success in Apache.
The httpd error log shows:
php.ini file is properly configured to include pgsql.so
extension_dir=/data/data/com.termux/files/usr/lib/php
File pgsql.so exists in /data/data/com.termux/files/usr/lib/php
-rwx------ 1 u0_a131 u0_a131 68616 Apr 27 02:15 pdo_pgsql.so
I am hopeful the above information wiil be useful to find a solution.
Thanks to @fornwall @vishalbiswas
@mozzworld we'll have to integrate pgsql support into php as well
@vishalbiswas That will be great!
i cant't find postgresql-contrib in repository termux when i'm manual installation METASPLOIT
i cant't find postgresql-contrib
@Hitlrsociety420 postgresql-contrib is part of postgresql package so it is normal that you can't find it.
Ok thank you. i'm i'm followed the termux wiki guides
pg_ctl -D /data/data/com.termux/files/usr/home/pg/postgresql -l logfile start
Saved my day thanks
another out of topic question i have the ubuntu chroot i start it till i get to the screen saying root@localhost—:# what's next am new to chrooting i tried sudo non seams to work i always get command not found
Most helpful comment
@annaduraiviki
Neither. Don't think in PC terms.PostgreSQL is a real database which came down from real computers. Not a wanna-be database coming up from wanna-be computers.
initdb ~/pgThat line initializes a directory path with various files the server will use, including a "default" database, but does not name a database.
pgctl -D ~/pg startStarts the daemon/server and tells it what directory path to use.
You have to physically create the database you wish to use. You can create any number of them limited only by storage space on that device.
This is an incredibly stripped down version of Ingress, at least as I remember. On real platforms we had one server instance with hundreds of paths strewn across many hundreds of disks. We had to. Those 14 inch disks only had 456 Meg of storage capacity back then.
http://gunkies.org/wiki/Ra81
On a standard Linux system (in this case KDE Neon) you need to do the following:
That will get you the help on all of the things you can do when creating a database.