openmolecules.org

 
Home » DataWarrior » Functionality » Postgresql connection (Parameters for connection)
Postgresql connection [message #789] Sat, 29 February 2020 14:53 Go to next message
polgia is currently offline  polgia
Messages: 2
Registered: February 2020
Location: italy
Junior Member
Hello,
I am trying to retrive a table from a Postgresql (v12) database installed on a local host. As connecting string, I am using the following : postgresql://127.0.0.1:50036/chemicals
because 127.0.0.1 is my local IP;, 50036 is the port; chemicals is the name of the database. In the SQL string, I put: SELECT * FROM pure_components; because I want to retrive the whole table named "pure_components".
If I use the same parameters, I can connect and retrive the table in python, so it seems they are correct. However, when I use them in Datawarrior via "Run Data from SQl-Database...", the software allows to dial user and password ( I use: postgres and mypassword) but then it freezes. No way to start it again and I have to stop the process. I suppose some parameters are supplied in a wrong way. My setup is quite common in a local installation. Any suggestion?
Thanks
Re: Postgresql connection [message #790 is a reply to message #789] Sun, 01 March 2020 17:51 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
To verify, I just installed Postgres.App on my Macintosh, installed a database, created a test table and inserted a row. When trying to access it with DataWarrior from the same Macintosh using the connect string 'postgresql://127.0.0.1:5432/thomas' and the SQL command 'select * from test', it worked fine.

Which OS do you use? Can you launch DataWarrior form the command line and see, whether you have any error messages? Can you retrieve data from other tables or use a WHERE clause to retrieve a subset? Which DataWarrior version do you use? Postgres needs at least 5.2.0.
Re: Postgresql connection [message #795 is a reply to message #790] Mon, 02 March 2020 17:47 Go to previous message
polgia is currently offline  polgia
Messages: 2
Registered: February 2020
Location: italy
Junior Member
Hi Thomas, thanks for answer.
I finally foound a solution by myself ( I am using Win 10). The problem was the port. For some reasons the port I have used was reserved to PGAdmin. Using the standard one: 5432 evethings works fine with the syntax you suggest. Thanks again.
Gianmarco
Previous Topic: Question about R-group occurences estimation
Next Topic: tautomer & protomer display
Goto Forum:
  


Current Time: Fri Nov 22 05:44:30 CET 2024

Total time taken to generate the page: 0.03885 seconds