AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Connecting to postgres from CS
 
 

I’m pretty certain I have a PG server running as I am able to get results on a select query after logging into a custom db using the postgres username and no password.

I use the the following commands to:

Start server- postgres -D C:\Program Files\PostgreSQL\9.4\data

Execute Query - psql -U postgres mydb <—- No password needed
                pqsl -U converseUser mydb <—- password supplied and validated

But all the following dbinit calls return “dbname mydb - fe_sendauth : no password supplied” in $$db_error:

dbinit(dbname=mydb port=5432 user=postgres password=)
dbinit(dbname=mydb port=5432 user=postgres password=abcde)
dbinit(dbname=mydb port=5432 user=postgres password=NULL)
dbinit(dbname=mydb port=5432 user=postgres)
dbinit(dbname=mydb port=5432 user=converseUser password=abcde)

 

 
  [ # 1 ]

So… I start with the basics. The simpletopic script for postgres bot uses spaces around the =

if (^dbinit( dbname = postgres port = 5432 user = postgres password = somepassword )) {db opened}

Your code does not show that. Have you tried it?

 

 
  [ # 2 ]

Whoa! Can’t believe I missed that. But even with the postgres db and all other versions of username and password I still get the same error.

I did start the call with spaces around the = but stopped when I received a $$db_error stating dbname - missing “=” after “dbname” in connection info string

 

 
  [ # 3 ]

problem appears to be in CS… stand by

 

 
  [ # 4 ]

I should add that what you’ve read so far is the result of my testing with chatscriptpg

Interestingly, when I tried running the same code in regular chatscript I got the following message:
Db opened ()} 00M (1) 00w {Db failed} 004

this was the code:
u: (pgconn) ^keep() ^repeat()
        if (dbinit( dbname=postgres port = 5432 user = postgres password = samoe ))
  {db opened dbclose()}
  else {db failed $$db_error}

 

 
  [ # 5 ]

had you said ^dbinit, your code would not have compiled.  the postgres functions are not defined at all in normal cs.  But since you didnt use ^  then it could be treated as english

 

 
  [ # 6 ]

new version up should fix your problem

 

 
  [ # 7 ]

I apologize for responding so late Bruce but thank you for taking the trouble to fix the problem

 

 
  login or register to react