Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » can I use 127.0.0.1 as host in open function?
can I use 127.0.0.1 as host in open function? [message #52523] Thu, 17 October 2019 03:05 Go to next message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

Hi Postgres users,

Can I use 127.0.0.1 instead of localhost for my host?

if(!m_session.Open("host=127.0.0.1 dbname=test user=myuser password=mypassword"))


I can log into the db with
psql -h 127.0.0.1 -d test -U myuser

and then entering mypassword at the prompt.

Not sure why I can't seem to get it to run.

My environments are Cygwin PostgreSQL backend and the U++ libpq.a client code that Mirek has going on for the front end.

I don't think it matters if I connect to a Cygwin db running on that host even if Cygwin isn't using MinGW.

I probably can mix the client and server as different environments.

thnx,
roboloki

Re: can I use 127.0.0.1 as host in open function? [message #52524 is a reply to message #52523] Thu, 17 October 2019 09:08 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 698
Registered: December 2005
Location: Budapest, Hungary
Contributor
Currently, I am using it with
"host=localhost port=5432 dbname=test user=test password=test"

I think, port is missing in your connect string.
Re: can I use 127.0.0.1 as host in open function? [message #52527 is a reply to message #52524] Thu, 17 October 2019 19:43 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

Hey zsolt-
I will try that after work this afternoon.
Very cool, thnx Smile
Re: can I use 127.0.0.1 as host in open function? [message #52528 is a reply to message #52527] Thu, 17 October 2019 20:10 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 698
Registered: December 2005
Location: Budapest, Hungary
Contributor
I checked, port is not needed, it defaults to 5432.
Just try reference/SQL_PostgreSql. It should be working out of the box with MSC 2017.
Re: can I use 127.0.0.1 as host in open function? [message #52529 is a reply to message #52528] Fri, 18 October 2019 01:08 Go to previous message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

hi zsolt-

I figured out the issues I had. It stems from not having the .a file for libpq.a for MinGW.
I need to get MinGW to get the .a file for the client instead of the .a file for Cygwin libpq.a
Well that is an easy fix. I just need to download another copy of MInGW. I think. Then I will use the ./configure and make and generate a PostgreSQL libpq.a and replace the Cygwin one. Then it will work.
It is not that I am mixing environments rather I didn't do it correctly.

thnx,
roboloki
Previous Topic: Missing SessionClose() in Sqlite3Session::Close()
Next Topic: GetInsertedId does not work for all data types.
Goto Forum:
  


Current Time: Sun Jun 23 00:28:46 CEST 2024

Total time taken to generate the page: 0.01968 seconds