Commit Graph

482 Commits

Author SHA1 Message Date
Bruce Momjian 3b382d1ae3 Clean up some relative path install issues with Claudio's help. 2004-05-18 03:36:45 +00:00
Bruce Momjian 3febb477e6 Reorganize code to allow path-relative installs.
Create new get_* functions to access compiled-in paths and adjust if
relative installs are to be used.

Clean up substitute_libpath_macro() code.
2004-05-17 14:35:34 +00:00
Bruce Momjian 85383214ea Rename backendbin to backend_exec in initdb.c. 2004-05-17 13:17:29 +00:00
Bruce Momjian 9f944f0443 Adjust find_my_exec/find_other_exec() so that the return parameter is
last, not first.  This fits our style better.
2004-05-14 17:04:48 +00:00
Bruce Momjian b1ffacddfc Rename find_my_binary/find_other_binary to
find_my_exec/find_other_exec().  Remove passing of progname to these
functions as they can find that out from argv[0], which they already
have.

Make get_progname return const char *, and update all progname variables
to be const char *.
2004-05-12 13:38:49 +00:00
Bruce Momjian fda15b351a As part of the work for making relocatable installs, I have re-factored
all the code that looks for other binaries.  I move FindExec into
port/exec.c (and renamed it to find_my_binary()).  I also added
find_other_binary that looks for another binary in the same directory as
the calling program, and checks the version string.

The only behavior change was that initdb and pg_dump would look in the
hard-coded bindir directory if it can't find the requested binary in the
same directory as the caller.  The new code throws an error.  The old
behavior seemed too error prone for version mismatches.
2004-05-11 21:57:15 +00:00
Bruce Momjian c50faf944d Add variables names to static prototypes in initdb.c. 2004-05-10 20:51:58 +00:00
Tom Lane 9e16195f3f Second try at a portable unsetenv(). 2004-05-05 21:18:29 +00:00
Tom Lane c7007d1848 Use a more portable technique for unsetting environment variables,
and unset PGCLIENTENCODING to prevent backend from dying if it's set
to something incompatible with the -E option.
2004-05-05 16:09:31 +00:00
Bruce Momjian f0f4e82f45 The win32 port backend will require the functionality provided by
canonicalize_path. Patch moves it from initdb.c to port/path.c.

Claudio Natoli
2004-03-09 04:49:02 +00:00
Bruce Momjian e5e5a323ca Briefly,
* configure + Makefile changes
 * shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
 * PATH env var separator differences
 * missing win32 rand functions added
 * placeholder replacements for sync etc under port.h


To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):

        * child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)

        * dirmod.c: comment out the elog calls

        * dfmgr.c: some hackage required to substitute_libpath_macro

        * slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)

Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...


Claudio Natoli
2004-02-02 00:11:31 +00:00
Neil Conway 08b0e60563 Fix a probably-harmless read of uninitialized memory in mkdir_p(), to
silence a valgrind warning.
2004-01-31 22:10:00 +00:00
Neil Conway 25b8b69eec Remove a superfluous semi-colon. 2004-01-31 21:18:00 +00:00
Tom Lane c77f363384 Ensure that close() and fclose() are checked for errors, at least in
cases involving writes.  Per recent discussion about the possibility
of close-time failures on some filesystems.  There is a TODO item for
this, too.
2004-01-26 22:35:32 +00:00
Tom Lane 358d032f98 Fix compile warning. 2003-12-23 21:50:38 +00:00
Peter Eisentraut b40b3306fa Remove pg_id. 2003-12-17 18:44:09 +00:00
Bruce Momjian 2712ca771d Fix initdb use of mkdir_p().
Andrew Dunstan
2003-12-01 23:15:47 +00:00
PostgreSQL Daemon 969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
Peter Eisentraut c95f54c5e0 More adjustment of error messages 2003-11-25 19:18:26 +00:00
Peter Eisentraut 040e1cef91 Make the messages and the options parsing a bit more standard. 2003-11-23 22:17:59 +00:00
Peter Eisentraut e2d9066527 Add NLS support. 2003-11-23 21:41:30 +00:00
Bruce Momjian 25487b12d0 Add FreeBSD mention for initdb.c. 2003-11-17 20:35:28 +00:00
Tom Lane 5945283599 Try to improve error handling for failures of backend subprocess. 2003-11-14 18:32:34 +00:00
Tom Lane 81e51ddc14 Add fflush() before popen() calls; avoids any possible problem with
double or out-of-sequence output with child process.
2003-11-14 17:30:41 +00:00
Tom Lane 0104fc11b9 Add missing logic to handle fixing permissions on an already-existing
data directory.  Also fix handling of error conditions associated with
data directory checking step (can't use a boolean to distinguish four
possible result states...)
2003-11-14 17:19:35 +00:00
Tom Lane 18f58a048e Preliminary code review for C version of initdb. Re-centralize handling
of option switches for backend, fix handling of COPY from data files so
that we won't have the newline-after-\. issue back again, add back some
comments and printouts lost from the shell script, etc.  Still needs work
for error handling; in particular the shell version worked much more
nicely for the case of a postgres executable that fails on invocation.
2003-11-13 23:46:31 +00:00
Bruce Momjian 90823299ad pgindent new initdb.c from Tom. 2003-11-13 20:12:47 +00:00
Bruce Momjian ad89c2ae25 Add owner description to initdb C code.
Andrew Dunstan
2003-11-13 15:01:40 +00:00
Tom Lane 9a9890d842 Add fflush() calls so that I'm-about-to-do-this messages actually
come out before the action is done.
2003-11-13 01:36:00 +00:00
Tom Lane 88dd65ae9f Fix lack of optreset. 2003-11-13 01:09:24 +00:00
Bruce Momjian 0ca6939c10 Updated version of initdb with "rmdir/del" call on Win32.
Other cleanups as discussed.
2003-11-10 22:52:10 +00:00
Bruce Momjian 279598bb71 Add C version of initdb, from Andrew Dunstan.
This is his original version with a binary rmdir() we might need in the
future.

I will commit an update version with cleanups shortly.
2003-11-10 22:51:16 +00:00