#3167: db.connect: connection to remote database does not work --------------------------+----------------------------------- Reporter: mlennert | Owner: grass-dev@… Type: defect | Status: new Priority: blocker | Milestone: 7.0.5 Component: Database | Version: unspecified Resolution: | Keywords: postgresql db.connect CPU: Unspecified | Platform: Unspecified --------------------------+-----------------------------------
Comment (by mlennert): Replying to [comment:10 mlennert]: > The issue arises when some of the fields are empty, as for usr and pwd in my example. Anything from that point on is ignored. When I set a username and password with db.login, my db.tables example works like a charm. > > See [http://stackoverflow.com/questions/1508754/how-do-i-parse-out-the- fields-in-a-comma-separated-string-using-sscanf-while-sup here] for a discussion of the issue. Would using strtok be an alternative, here ? Or better yet: G_tokenize() ? I've attached a proof-of-concept patch that solves the problem for me, but it hardcodes the number of tokens. I don't know what forms login strings can potentially take, so this definitely needs to be revised to take into account different scenarios. -- Ticket URL: <https://trac.osgeo.org/grass/ticket/3167#comment:11> GRASS GIS <https://grass.osgeo.org> _______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev