Strange code in initdb

Started by Peter Eisentrautover 21 years ago5 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

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/

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: Strange code in initdb

Peter Eisentraut <peter_e@gmx.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

#3Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#1)
Re: Strange code in initdb

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@postgresql.org so that your
message can get through to the mailing list cleanly

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

Attachments:

/bjm/difftext/plainDownload+49-34
#4Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#3)
Re: Strange code in initdb

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/

#5Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#4)
Re: Strange code in initdb

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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073