Re: Strange code in initdb

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Strange code in initdb
Date: 2004-10-12 18:29:56
Message-ID: 200410122029.56902.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

What is this trying to tell us?

if (ret == -1)
fprintf(stderr,
_("The program \"postgres\" is needed by %s "
"but was not found in the same directory as \"%s\".\n"
"Check your installation.\n"),
progname, progname);
else
fprintf(stderr,
_("The program \"postgres\" was found by %s "
"but was not the same version as \"%s\".\n"
"Check your installation.\n"),
progname, progname);

Shouldn't the second progname be argv[0] or something else that contains
the full path?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Strange code in initdb
Date: 2004-10-12 19:14:13
Message-ID: 5599.1097608453@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Shouldn't the second progname be argv[0] or something else that contains
> the full path?

argv[0] doesn't necessarily contain the full path. Is it worth calling
find_my_exec() here to produce an absolute path? Possibly...

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Strange code in initdb
Date: 2004-10-15 04:24:34
Message-ID: 200410150424.i9F4OY008992@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


I have modified these reports so they print the full path used.

Typical pg_dumpall output is:

The program "pg_dump" is needed by pg_dumpall but was not found in the
same directory as "/usr/local/postgres/bin/pg_dumpall".
Check your installation.

---------------------------------------------------------------------------

Peter Eisentraut wrote:
> What is this trying to tell us?
>
> if (ret == -1)
> fprintf(stderr,
> _("The program \"postgres\" is needed by %s "
> "but was not found in the same directory as \"%s\".\n"
> "Check your installation.\n"),
> progname, progname);
> else
> fprintf(stderr,
> _("The program \"postgres\" was found by %s "
> "but was not the same version as \"%s\".\n"
> "Check your installation.\n"),
> progname, progname);
>
> Shouldn't the second progname be argv[0] or something else that contains
> the full path?
>
> --
> Peter Eisentraut
> http://developer.postgresql.org/~petere/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 4.9 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Strange code in initdb
Date: 2004-10-15 12:15:11
Message-ID: 200410151415.11635.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Am Freitag, 15. Oktober 2004 06:24 schrieb Bruce Momjian:
> I have modified these reports so they print the full path used.
>
> Typical pg_dumpall output is:
>
> The program "pg_dump" is needed by pg_dumpall but was not found in the
> same directory as "/usr/local/postgres/bin/pg_dumpall".
> Check your installation.

Yes, that is what I thought it should have been. There are similar pieces of
code in pg_dumpall, initdb, pg_ctl, and maybe elsewhere. Did you get them
all?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Strange code in initdb
Date: 2004-10-15 16:08:19
Message-ID: 200410151608.i9FG8JC07236@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Am Freitag, 15. Oktober 2004 06:24 schrieb Bruce Momjian:
> > I have modified these reports so they print the full path used.
> >
> > Typical pg_dumpall output is:
> >
> > The program "pg_dump" is needed by pg_dumpall but was not found in the
> > same directory as "/usr/local/postgres/bin/pg_dumpall".
> > Check your installation.
>
> Yes, that is what I thought it should have been. There are similar pieces of
> code in pg_dumpall, initdb, pg_ctl, and maybe elsewhere. Did you get them
> all?

Yes.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073