Yes, I'm able to connect to postgres using the following command.
1. psql -h 127.0.0.1 -p 5432 -U username dbname
So, what should I do? Thanks.
User Profile
Collapse
-
Connection to postgres database failed
Hello,
I got "Connection to database failed." error from the following C program. Could anyone help me to solve this problem?
#include <stdio.h>
#include <stdlib.h>
#include "libpq-fe.h"
int
main()
{
char state_code[3];
char query_string[256];
PGconn *conn;
PGresult *res;
int i;
conn = PQconnectdb("ho st=127.0.0.1... -
Internal Server Error in connecting Postgresql Server
Hello,
I wrote C program for connecting to postgresSQL server to retrieve data from the postgres database. The program is:
#include <stdio.h>
#include <stdlib.h>
#include "libpq-fe.h"
int
Search(inStruct Sentries)
{
char state_code[3];
char query_string[256]; ...
No activity results to display
Show More
Leave a comment: