pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedProblems between Mandrake and pg
4+ messages / 4 participants
[nested] [flat]
* Problems between Mandrake and pg
@ 2001-11-21 13:44 Ryan Rohde Hansen <rrha00@control.auc.dk>
2001-11-21 16:31 ` Re: Problems between Mandrake and pg Björn Lundin <bjorn.lundin@swipnet.se>
2001-11-24 03:03 ` Re: Problems between Mandrake and pg Chad R. Larson <chad@eldocomp.com>
2001-11-24 23:06 ` Re: Problems between Mandrake and pg Ian Barwick <barwick@gmx.net>
0 siblings, 3 replies; 4+ messages in thread
From: Ryan Rohde Hansen @ 2001-11-21 13:44 UTC (permalink / raw)
To: pgsql-admin
Hi
We are a group studying at Aalborg University. We are at the moment
developing a postgresql-db (7.1.3) on Mandrake 8.0, which we intend to
access via libpq. But at the moment we can't even connect to the db.
The connection is refused and we are asked if the -i option has been set
in the startup of postmaster:
[01gr551@ika dbkode]$ ./test1
Connection to host=localhost dbname=01gr551 failed, PQconnectPoll()
-- connect()
failed: Connection refused
Is the postmaster running (with -i) at 'localhost'
and accepting connections on TCP/IP port '5432'?
The program we are running:
#include <stdlib.h>
#include <stdio.h>
#include </usr/local/pgsql/include/libpq-fe.h>
int main()
{
PGconn *conn;
const char *connection_str = "host=localhost dbname=01gr551";
conn = PQconnectdb(connection_str);
if (PQstatus(conn) == CONNECTION_BAD) {
fprintf(stderr, "Connection to %s failed, %s", connection_str,
PQerrorMessage(conn));
} else {
printf("Connected OK\n");
}
PQfinish(conn);
return EXIT_SUCCESS;
}
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Problems between Mandrake and pg
2001-11-21 13:44 Problems between Mandrake and pg Ryan Rohde Hansen <rrha00@control.auc.dk>
@ 2001-11-21 16:31 ` Björn Lundin <bjorn.lundin@swipnet.se>
2 siblings, 0 replies; 4+ messages in thread
From: Björn Lundin @ 2001-11-21 16:31 UTC (permalink / raw)
To: pgsql-admin
>
> From the user it cannot be seen if postmaster is running (pg_ctl
> status), but from root it is apparent that it does. It is true, that we
> do not have the -i option on, but we haven't found a way to change it
> that really works. We have tried changing the options in a file called
> postmaster.opts but it didn't work.
>
> Does anyone have a suggestion of what to do?
the postmaster MUST run with the -i option or else the error you get is
normal behaviour. Only local unix sockets are allowed then.
man pg_ctl says postmaster.opts.default as the file to change.
Try pg_ctl -o " -i" start.
Good Luck
Björn Lundin
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Problems between Mandrake and pg
2001-11-21 13:44 Problems between Mandrake and pg Ryan Rohde Hansen <rrha00@control.auc.dk>
@ 2001-11-24 03:03 ` Chad R. Larson <chad@eldocomp.com>
2 siblings, 0 replies; 4+ messages in thread
From: Chad R. Larson @ 2001-11-24 03:03 UTC (permalink / raw)
To: ryan@eidolon.dk; pgsql-admin
At 02:44 PM 11/21/01 +0100, Ryan Rohde Hansen wrote:
>It is true, that we do not have the -i option on, but we haven't found a
>way to change it that really works.
You MUST have the -i switch set, or else you can only make connections to
the database from the machine it run on.
Attached are two scripts. One is for FreeBSD, the other is for Solaris.
The FreeBSD script goes in /usr/local/etc/rc.d and the Solaris one goes in
/etc/init.d (and then run it by hand once with the argument "links").
I don't know much about Mandrake, but these scripts should give you the idea.
-crl
--
Chad R. Larson (CRL22) chad@eldocomp.com
Eldorado Computing, Inc. 602-604-3100
5353 North 16th Street, Suite 400
Phoenix, Arizona 85016-3228
Attachments:
postgres (application/octet-stream, 2.6K) download
pgsql.sh (application/octet-stream, 807B) download
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Problems between Mandrake and pg
2001-11-21 13:44 Problems between Mandrake and pg Ryan Rohde Hansen <rrha00@control.auc.dk>
@ 2001-11-24 23:06 ` Ian Barwick <barwick@gmx.net>
2 siblings, 0 replies; 4+ messages in thread
From: Ian Barwick @ 2001-11-24 23:06 UTC (permalink / raw)
To: ryan@eidolon.dk, Ryan Rohde Hansen <rrha00@control.auc.dk>; pgsql-admin
Hi
On Wednesday 21 November 2001 14:44, Ryan Rohde Hansen wrote:
> We are a group studying at Aalborg University. We are at the moment
> developing a postgresql-db (7.1.3) on Mandrake 8.0, which we intend to
> access via libpq. But at the moment we can't even connect to the db.
> The connection is refused and we are asked if the -i option has been set
> in the startup of postmaster:
>
> [01gr551@ika dbkode]$ ./test1
> Connection to host=localhost dbname=01gr551 failed, PQconnectPoll()
> -- connect()
> failed: Connection refused
> Is the postmaster running (with -i) at 'localhost'
> and accepting connections on TCP/IP port '5432'?
>
> The program we are running:
>
> #include <stdlib.h>
> #include <stdio.h>
> #include </usr/local/pgsql/include/libpq-fe.h>
>
> int main()
> {
>
> PGconn *conn;
> const char *connection_str = "host=localhost dbname=01gr551";
Try leaving out the "host=localhost" part of the above string.
If the backend process isn't accepting connections on a TCP/IP port,
specifying a host name (even if it's the name of the local machine)
forces a connect to the port, which causes the above error.
See also:
http://www.postgresql.org/idocs/index.php?postmaster-start.html#CLIENT-CONNECTION-PROBLEMS
HTH
Ian Barwick
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2001-11-24 23:06 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-21 13:44 Problems between Mandrake and pg Ryan Rohde Hansen <rrha00@control.auc.dk>
2001-11-21 16:31 ` Björn Lundin <bjorn.lundin@swipnet.se>
2001-11-24 03:03 ` Chad R. Larson <chad@eldocomp.com>
2001-11-24 23:06 ` Ian Barwick <barwick@gmx.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox