The same thing is happening when I compile the sample program:
postgresql-6.4.2/src/test/examples/testlibpq.c
when I put my own database name and set some of the PG env. variables.
bash$ testlibpq
Connection to database 'mydb' failed.
Unsupported frontend protocol.bash$
Bob Von
Yes, I can connect via JDBC and via 'psql -h mypghost.com mydb'
Statistical Solutions wrote:
> Are you running postgres with the -i option??? For postgres to work with
> tcp/ip, you need to launch postmaster with the -i option.
>
> steve
>
> On Sat, 3 Apr 1999,
Bob VonMoss wrote:
> I'm trying to connect to a database from a C++ program compiled with
> g++, linked to the libpq library on a Sun Solaris system. It is compiled
> and run like this (my actual information has been changed to pseudonyms,
> like mypghost.com, etc.)
>
>
{
fprintf(stderr, "Connection to database '%s' failed.\n",
dbName);
fprintf(stderr, "%s", PQerrorMessage(conn));
exit_nicely(conn);
}
...
}
--
Bob VonMoss
mailto:[EMAIL PROTECTED]
from Chicago, IL
igure' and recompiled libpq.a
--
Bob VonMoss
mailto:[EMAIL PROTECTED]
from Chicago, IL
ELECT * FROM a WHERE '' <= a AND a < 'C';
--
Bob VonMoss
mailto:[EMAIL PROTECTED]
from Chicago, IL
Tom Lane wrote:
> Bob VonMoss <[EMAIL PROTECTED]> writes:
> > [ can connect via unix socket, but not via TCP ]
>
> > The administrator says this is how postmaster is invoked:
> > /usr/local/pgsql/bin/postmaster -S -i -D /usr/local/pgsql/data -p 5432
>
> OK, th
System.out.println(""+se);
return;
}
System.out.println(
"closing connection to the PostGreSQL DB...");
try {
con.close();
} catch (SQLException se) {
System.out.println(""+se);
}
System.out.println(
"connection to the PostGreSQL DB closed successfully");
}
}
--
Bob VonMoss
mailto:[EMAIL PROTECTED]
from Chicago, IL