Commit Graph

400 Commits

Author SHA1 Message Date
Bruce Momjian 33829a5e0f Throw error if initdb -L is not an absolute path. 2004-08-16 15:44:03 +00:00
Tom Lane 250e516051 Cause initdb to actually accept -s as intended, and fix some typos in
a comment.

Jon Jensen
2004-08-11 23:28:54 +00:00
Peter Eisentraut 81cca21818 Allow compilation when CODESET is not defined (OpenBSD). 2004-08-11 11:06:23 +00:00
Tom Lane b06c907645 Path-mangling logic was failing to account for paths containing mentions
of '.' or '..'.  Extend canonicalize_path() to trim off trailing occurrences
of these things, and use it to fix up paths where needed (which I think is
only after places where we trim the last path component, but maybe some
others will turn up).  Fixes Josh's complaint that './initdb' does not
work.
2004-08-09 20:20:47 +00:00
Bruce Momjian ca9540d34f Add docs for initdb --auth. 2004-08-01 06:19:26 +00:00
Bruce Momjian e7029b2127 >I got a new idea on this. I think we should add an initdb option that
>takes a string to specify the local authentication method:
>
>       initdb --auth 'ident'
>
>or whatever the user wants.  I think this is more flexible and more
>compact.  It would default to 'trust', and the packagers could
>set it to
>whatever they want.  If their OS supports local ident, they can use
>that.
>
>Also keep in mind you might want some ident map file:
>
>       initdb --auth 'ident mymap'
>
>so you would need to allow multiple words in the string.

Magnus Hagander
2004-08-01 05:59:13 +00:00
Tom Lane 66ec2db728 XLOG file archiving and point-in-time recovery. There are still some
loose ends and a glaring lack of documentation, but it basically works.

Simon Riggs with some editorialization by Tom Lane.
2004-07-19 02:47:16 +00:00
Peter Eisentraut a837ed88b1 Detect locale/encoding mismatch in initdb, or pick a suitable encoding
automatically if none was specified.
2004-07-14 17:55:10 +00:00
Bruce Momjian 66d56a8efe Fix username mismatch in initdb. Magnus. 2004-07-12 01:54:10 +00:00
Tom Lane 573a71a5da Nested transactions. There is still much left to do, especially on the
performance front, but with feature freeze upon us I think it's time to
drive a stake in the ground and say that this will be in 7.5.

Alvaro Herrera, with some help from Tom Lane.
2004-07-01 00:52:04 +00:00
Tom Lane 1b80b6da6a Add --pwfile option to initdb, so that passwords can be set by GUI tools
that aren't able to feed the password to initdb's /dev/tty.

Magnus Hagander
2004-06-24 19:26:59 +00:00
Bruce Momjian 483b7f8249 Rename pg_tablespaces directory to pg_tblspc, so it is more unique from
the pg_tablespace table.  Update catalog version.
2004-06-21 01:04:45 +00:00
Tom Lane 2467394ee1 Tablespaces. Alternate database locations are dead, long live tablespaces.
There are various things left to do: contrib dbsize and oid2name modules
need work, and so does the documentation.  Also someone should think about
COMMENT ON TABLESPACE and maybe RENAME TABLESPACE.  Also initlocation is
dead, it just doesn't know it yet.

Gavin Sherry and Tom Lane.
2004-06-18 06:14:31 +00:00
Bruce Momjian 6cc4175b25 Attached is a patch that takes care of the PATHSEP issue. I made a more
extensive change then what was suggested. I found the file path.c that
contained a lot of "Unix/Windows" agnostic functions so I added a function
there instead and removed the PATHSEP declaration in exec.c altogether. All
to keep things from scattering all over the code.

I also took the liberty of changing the name of the functions
"first_path_sep" and "last_path_sep". Where I come from (and I'm apparently
not alone given the former macro name PATHSEP), they should be called
"first_dir_sep" and "last_dir_sep". The new function I introduced, that
actually finds path separators, is now the "first_path_sep". The patch
contains changes on all affected places of course.

I also changed the documentation on dynamic_library_path to reflect the
chagnes.

Thomas Hallgren
2004-06-10 22:26:24 +00:00
Bruce Momjian 10a3d19ad4 Handle multiple double-quoted strings using Win32's system() call.
Document limitations.
2004-06-10 16:35:18 +00:00
Bruce Momjian 6870843339 Add PGETC (for pg_service.conf) and PGLOCALE (for locale dir)
environment variable processing to libpq.

The patch also adds code to our client apps so we set the environment
variable directly based on our binary location, unless it is already
set. This will allow our applications to emit proper locale messages
that are generated in libpq.
2004-06-03 00:07:38 +00:00
Bruce Momjian 6c33054a0c Remove init_nls() functions, call set_pglocale() directly.
Add locale to pg_ctl.c.
2004-06-01 02:54:09 +00:00
Bruce Momjian 228897774c Make the locale location relocatable.
Adjust get_*_path functions to be limited to MAXPGPATH.
2004-05-25 01:00:30 +00:00
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