Commit Graph

482 Commits

Author SHA1 Message Date
Peter Eisentraut 4ab8fcba8a StrNCpy -> strlcpy (not complete) 2007-02-10 14:58:55 +00:00
Bruce Momjian 8b4ff8b6a1 Wording cleanup for error messages. Also change can't -> cannot.
Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".
2007-02-01 19:10:30 +00:00
Tom Lane 068bf6534f Fix initdb to not generate misleading error messages when postgres.bki
or other share-directory files are inaccessible for some reason other
than not existing.  Inspired by trouble report from Simon Kinsella.
2007-01-31 18:52:49 +00:00
Bruce Momjian f5f9577e50 Modify max_fsm_pages in postgresql.conf.sample to show a typical value,
rather than a value too high.
2007-01-20 17:04:58 +00:00
Bruce Momjian c3578a68f8 Allow initdb to specify the pg_xlog directory.
Euler Taveira de Oliveira
2007-01-06 19:40:00 +00:00
Bruce Momjian 29dccf5fe0 Update CVS HEAD for 2007 copyright. Back branches are typically not
back-stamped for this.
2007-01-05 22:20:05 +00:00
Tom Lane a78fcfb512 Restructure operator classes to allow improved handling of cross-data-type
cases.  Operator classes now exist within "operator families".  While most
families are equivalent to a single class, related classes can be grouped
into one family to represent the fact that they are semantically compatible.
Cross-type operators are now naturally adjunct parts of a family, without
having to wedge them into a particular opclass as we had done originally.

This commit restructures the catalogs and cleans up enough of the fallout so
that everything still works at least as well as before, but most of the work
needed to actually improve the planner's behavior will come later.  Also,
there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way
to create a new family right now is to allow CREATE OPERATOR CLASS to make
one by default.  I owe some more documentation work, too.  But that can all
be done in smaller pieces once this infrastructure is in place.
2006-12-23 00:43:13 +00:00
Tom Lane ff40057116 Fix initdb's logic for picking shared_buffers/max_fsm_pages, which had
gotten rather thoroughly whacked out by careless recent changes: the
intended ratio between the two was off by a lot, and the minimum number
of shared buffers tried had increased by a lot.  Problem exposed by
failures on buildfarm members with smaller SHMMAX values.
2006-10-04 18:58:08 +00:00
Bruce Momjian f99a569a2e pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
Bruce Momjian 5441a64164 The attached patch changes units of the some default values in
postgresql.conf.

- shared_buffers = 32000kB => 32MB
- temp_buffers = 8000kB => 8MB
- wal_buffers = 8 => 64kB

The code of initdb was a bit modified to write MB-unit values.
Values greater than 8000kB are rounded out to MB.

GUC_UNIT_XBLOCKS is added for wal_buffers. It is like GUC_UNIT_BLOCKS,
but uses XLOG_BLCKSZ instead of BLCKSZ.

Also, I cleaned up the test of GUC_UNIT_* flags in preparation to
add more unit flags in less bits.

ITAGAKI Takahiro
2006-10-03 21:11:55 +00:00
Bruce Momjian fa6f9ceab6 Make postgresql.conf.sample match the initdb defaults. This fixes
comment alignment on most systems.
2006-09-14 23:21:47 +00:00
Michael Meskes 4e23d6e07d Fixed a few trivial memory leaks reported by Coverity just to test my setup. 2006-08-20 16:08:09 +00:00
Tom Lane 6e38e34d64 Change the bootstrap sequence so that toast tables for system catalogs are
created in the bootstrap phase proper, rather than added after-the-fact
by initdb.  This is cleaner than before because it allows us to retire the
undocumented ALTER TABLE ... CREATE TOAST TABLE command, but the real reason
I'm doing it is so that toast tables of shared catalogs will now have
predetermined OIDs.  This will allow a reasonably clean solution to the
problem of locking tables before we load their relcache entries, to appear
in a forthcoming patch.
2006-07-31 01:16:38 +00:00
Peter Eisentraut b517e65348 Allow units to be specified with configuration settings. 2006-07-27 08:30:41 +00:00
Peter Eisentraut 5266f221a2 Merge postmaster and postgres command into just postgres. postmaster
symlink is kept for now for compatibility.  To call single-user mode, use
postgres --single.
2006-06-18 15:38:37 +00:00
Bruce Momjian 399a36a75d Prepare code to be built by MSVC:
o  remove many WIN32_CLIENT_ONLY defines
	o  add WIN32_ONLY_COMPILER define
	o  add 3rd argument to open() for portability
	o  add include/port/win32_msvc directory for
	   system includes

Magnus Hagander
2006-06-07 22:24:46 +00:00
Tom Lane 58a2dbc740 Fix initdb to properly escape quotes and backslashes in the supplied
superuser password, and also in the paths of the various files it issues
SQL COPY commands for.  Per bug #2424.
2006-05-27 18:07:06 +00:00
Bruce Momjian 7a846ecc00 Use E'' strings internally only when standard_conforming_strings =
'off'. This allows pg_dump output with standard_conforming_strings =
'on' to generate proper strings that can be loaded into other databases
without the backslash doubling we typically do.  I have added the
dumping of the standard_conforming_strings value to pg_dump.

I also added standard backslash handling for plpgsql.
2006-05-26 23:48:54 +00:00
Alvaro Herrera c4826cf0b0 Merge the loading of shared object descriptions with regular descriptions,
both in code and in the messages emitted to the user.
2006-03-21 17:54:28 +00:00
Bruce Momjian f2f5b05655 Update copyright for 2006. Update scripts. 2006-03-05 15:59:11 +00:00
Andrew Dunstan 2b695717a7 Make restricted_exec feature for Windows more robust by using the environment
to pass the flag instead of the command line - some implementations of
getopt fail if getopt arguments are present after non-getopt arguments.
2006-02-24 02:02:41 +00:00
Andrew Dunstan b5fe16d09f make initdb -U username work as advertised; back out bogus patch at rev 1.42
and supply real fix for problem it tried to address.
2006-02-24 00:55:49 +00:00
Peter Eisentraut 1b658473ea Add support for Windows codepages 1253, 1254, 1255, and 1257 and clean
up a bunch of the support utilities.

In src/backend/utils/mb/Unicode remove nearly duplicate copies of the
UCS_to_XXX perl script and replace with one version to handle all generic
files.  Update the Makefile so that it knows about all the map files.
This produces a slight difference in some of the map files, using a
uniform naming convention and not mapping the null character.

In src/backend/utils/mb/conversion_procs create a master utf8<->win
codepage function like the ISO 8859 versions instead of having a separate
handler for each conversion.

There is an externally visible change in the name of the win1258 to utf8
conversion.  According to the documentation notes, it was named
incorrectly and this changes it to a standard name.

Running the Unicode mapping perl scripts has shown some additional mapping
changes in koi8r and iso8859-7.
2006-02-18 16:15:23 +00:00
Bruce Momjian f9a726aa88 I've created a new shared catalog table pg_shdescription to store
comments on cluster global objects like databases, tablespaces, and
roles.

It touches a lot of places, but not much in the way of big changes.  The
only design decision I made was to duplicate the query and manipulation
functions rather than to try and have them handle both shared and local
comments.  I believe this is simpler for the code and not an issue for
callers because they know what type of object they are dealing with.
This has resulted in a shobj_description function analagous to
obj_description and backend functions [Create/Delete]SharedComments
mirroring the existing [Create/Delete]Comments functions.

pg_shdescription.h goes into src/include/catalog/

Kris Jurka
2006-02-12 03:22:21 +00:00
Tom Lane fc9c20eb72 Make it possible to run initdb from an admin account on Windows,
by giving up admin privileges (only works if newer than NT4).

Magnus
2006-02-10 22:05:42 +00:00
Tom Lane cab99ec300 Tweak initdb to reduce verbosity of progress messages, by printing just
one 'creating subdirectories' message instead of one per subdirectory.
The original decision to print something for each subdirectory was made
when there were only one or two of 'em; we have way too many now.
Per discussion.
2006-01-27 19:01:15 +00:00
Peter Eisentraut 86c23a6eb2 Make all command-line options of postmaster and postgres the same. See
http://archives.postgresql.org/pgsql-hackers/2006-01/msg00151.php for the
complete plan.
2006-01-05 10:07:46 +00:00
Bruce Momjian 44f9021223 Remove BEOS port. 2006-01-05 03:01:38 +00:00
Andrew Dunstan 14d6c9fe6f Remove the nexus between trial_buffs and trial_conns, and don't test shared buffers lower than or equal to a value we already know is good, but use that value instead. This will make it easier to adjust the trial values and/or formulae in future if necessary. 2006-01-02 16:45:12 +00:00
Tom Lane bcb26d74cb Clean up initdb's code for selecting max_connections and shared_buffers
a little bit, and set the minimum buffers-per-connection ratio to 10 not
5.  I folded the two test routines into one to counteract the illusion
that the tests can be twiddled independently, and added some documentation
pointing out the necessary connection between the sets of values tested.
Fixes strange choices of parameters that I noticed CVS tip making on
Darwin with Apple's undersized default SHMMAX.
2005-12-31 23:50:59 +00:00
Andrew Dunstan a37422e042 Increase amount of shared buffers initdb tries to allocate to 4000,
and add logic to try max_fsm_pages up to 200000, plus accompanying minor
docs changes.
2005-12-27 23:54:01 +00:00
Peter Eisentraut 625d4b38e0 Let initdb detect the date order of the lc_time locale and initialize the
datestyle parameter of the new cluster accordingly.
2005-12-09 15:51:14 +00:00
Bruce Momjian 436a2956d8 Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib
directory.  Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).

Backpatch to 8.1.X.
2005-11-22 18:17:34 +00:00
Bruce Momjian 1dc3498251 Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
Bruce Momjian 75e90bbf69 Fix initdb quoting for Win32 paths in final examples, per Dave Page. 2005-08-28 22:21:46 +00:00
Tom Lane 9e56c5a4cf Windows needs WSAStartup() before getaddrinfo() will work. Andrew Dunstan 2005-08-27 18:44:03 +00:00
Tom Lane 15df139a8c Original assumption that our own getaddrinfo routine would never support
IPv6 is obsoleted by recent Windows patch.  Perform the runtime test
whenever HAVE_IPV6 is set.  This should be OK since initdb can get
getaddrinfo from libpgport if needed.
2005-08-25 02:22:59 +00:00
Tom Lane f88e8070b7 Use an initdb-time test to see if the local version of getaddrinfo()
chokes on IPv6 addresses, and comment out the IPv6 entry in the default
pg_hba.conf if so.  Per Andrew Dunstan.
2005-08-22 16:27:36 +00:00
Tom Lane 74888b9349 Add ERROR_NO_MORE_FILES workaround to check_data_dir(). This may or
may not be obsolete, but since every other readdir loop in our code
has it, I think this should too.
2005-08-02 15:16:27 +00:00
Tom Lane 4a2972d691 Awhile back we replaced all uses of strcasecmp and strncasecmp with
pg_strcasecmp and pg_strncasecmp ... but I see some of the former have
crept back in.
Eternal vigilance is the price of locale independence, apparently.
2005-07-25 04:52:32 +00:00
Bruce Momjian e8a3e6b8a0 Rename xmalloc to pg_malloc for consistency with psql usage.
Add missing plperl include.
2005-07-10 16:13:13 +00:00
Tom Lane 59d1b3d99e Track dependencies on shared objects (which is to say, roles; we already
have adequate mechanisms for tracking the contents of databases and
tablespaces).  This solves the longstanding problem that you can drop a
user who still owns objects and/or has access permissions.
Alvaro Herrera, with some kibitzing from Tom Lane.
2005-07-07 20:40:02 +00:00
Bruce Momjian 74b49a8129 Add E'' to internally created SQL strings that contain backslashes.
Improve code clarity by using macros for E'' processing.
2005-07-02 17:01:59 +00:00
Bruce Momjian 2f7d369a5c Clarify code to double \\ and '. 2005-07-01 17:40:29 +00:00
Tom Lane 365205dd2a Fix broken initdb -W option, per Michael Fuhr. 2005-06-28 15:38:12 +00:00
Tom Lane 7762619e95 Replace pg_shadow and pg_group by new role-capable catalogs pg_authid
and pg_auth_members.  There are still many loose ends to finish in this
patch (no documentation, no regression tests, no pg_dump support for
instance).  But I'm going to commit it now anyway so that Alvaro can
make some progress on shared dependencies.  The catalog changes should
be pretty much done.
2005-06-28 05:09:14 +00:00
Bruce Momjian bb3cce4ec9 Add E'' syntax so eventually normal strings can treat backslashes
literally.

Add GUC variables:

        "escape_string_warning" - warn about backslashes in non-E strings
        "escape_string_syntax" - supports E'' syntax?
        "standard_compliant_strings" - treats backslashes literally in ''

Update code to use E'' when escapes are used.
2005-06-26 03:04:37 +00:00
Tom Lane 6f7fc0bade Cause initdb to create a third standard database "postgres", which
unlike template0 and template1 does not have any special status in
terms of backend functionality.  However, all external utilities such
as createuser and createdb now connect to "postgres" instead of
template1, and the documentation is changed to encourage people to use
"postgres" instead of template1 as a play area.  This should fix some
longstanding gotchas involving unexpected propagation of database
objects by createdb (when you used template1 without understanding
the implications), as well as ameliorating the problem that CREATE
DATABASE is unhappy if anyone else is connected to template1.
Patch by Dave Page, minor editing by Tom Lane.  All per recent
pghackers discussions.
2005-06-21 04:02:34 +00:00
Tom Lane d0a89683a3 Two-phase commit. Original patch by Heikki Linnakangas, with additional
hacking by Alvaro Herrera and Tom Lane.
2005-06-17 22:32:51 +00:00
Neil Conway 47458f8c2f GCC 4.0 includes a new warning option, -Wformat-literal, that emits
a warning when a variable is used as a format string for printf()
and similar functions (if the variable is derived from untrusted
data, it could include unexpected formatting sequences). This
emits too many warnings to be enabled by default, but it does
flag a few dubious constructs in the Postgres tree. This patch
fixes up the obvious variants: functions that are passed a variable
format string but no additional arguments.

Most of these are harmless (e.g. the ruleutils stuff), but there
is at least one actual bug here: if you create a trigger named
"%sfoo", pg_dump will read uninitialized memory and fail to dump
the trigger correctly.
2005-04-30 08:08:51 +00:00
Tom Lane bedb78d386 Implement sharable row-level locks, and use them for foreign key references
to eliminate unnecessary deadlocks.  This commit adds SELECT ... FOR SHARE
paralleling SELECT ... FOR UPDATE.  The implementation uses a new SLRU
data structure (managed much like pg_subtrans) to represent multiple-
transaction-ID sets.  When more than one transaction is holding a shared
lock on a particular row, we create a MultiXactId representing that set
of transactions and store its ID in the row's XMAX.  This scheme allows
an effectively unlimited number of row locks, just as we did before,
while not costing any extra overhead except when a shared lock actually
has to be shared.   Still TODO: use the regular lock manager to control
the grant order when multiple backends are waiting for a row lock.

Alvaro Herrera and Tom Lane.
2005-04-28 21:47:18 +00:00
Tom Lane dffab0c88d Remove unnecessary UPDATE commands to assign explicit ACLs to functions
and PL languages during initdb.  The default permissions for these objects
are the same as what we were assigning anyway, so there is no need to
expend space in the catalogs on them.  The space cost is particularly
significant in pg_proc's indexes, which are bloated by about a factor of 2
by the full-table update, and can never really recover the space.
initdb not forced, since the change has no actual impact on behavior.
2005-04-12 19:29:24 +00:00
Peter Eisentraut c580d94541 Revert mistaken renaming of UTF-8. 2005-04-12 14:19:43 +00:00
Bruce Momjian e7fb9f18bf Add support for Win1252 encoding.
Roland Volkmann
2005-03-14 18:31:25 +00:00
Bruce Momjian 6521cd9ae1 Add 'static' to initdb.c file-global variables. 2005-03-11 15:36:27 +00:00
Bruce Momjian e3d7de6b99 Rename canonical encodings, per Peter:
UNICODE => UTF8
	ALT => WIN866
	WIN => WIN1251
	TCVN => WIN1258

The old codes continue to work.
2005-03-07 04:30:55 +00:00
Tom Lane 0fc4ecf935 Finish up the flat-files project: get rid of GetRawDatabaseInfo() hack
in favor of looking at the flat file copy of pg_database during backend
startup.  This should finally eliminate the various corner cases in which
backend startup fails unexpectedly because it isn't able to distinguish
live and dead tuples in pg_database.  Simplify locking on pg_database
to be similar to the rules used with pg_shadow and pg_group, and eliminate
FlushRelationBuffers operations that were used only to reduce the odds
of failure of GetRawDatabaseInfo.
initdb forced due to addition of a trigger to pg_database.
2005-02-26 18:43:34 +00:00
Bruce Momjian 0542b1e2fe Use _() macro consistently rather than gettext(). Add translation
macros around strings that were missing them.
2005-02-22 04:43:23 +00:00
Tom Lane bb1bd3276e Adjust mkdir_p to do stat() before trying mkdir(). Avoids problems on
Solaris and should be a little faster anyway, since in most scenarios
all but perhaps the last path component will already exist.
2005-01-28 00:34:32 +00:00
Tom Lane 8afe005f42 Consistently use geteuid() not getuid(); there were a few places deviating
from our long-established standard.
2005-01-08 22:51:15 +00:00
PostgreSQL Daemon 2ff501590b Tag appropriate files for rc3
Also performed an initial run through of upgrading our Copyright date to
extend to 2005 ... first run here was very simple ... change everything
where: grep 1996-2004 && the word 'Copyright' ... scanned through the
generated list with 'less' first, and after, to make sure that I only
picked up the right entries ...
2004-12-31 22:04:05 +00:00
Tom Lane 361f354109 Make sure --with-pgport option propagates into postgresql.conf.
Per gripe from Josh Berkus.
2004-12-27 20:39:21 +00:00
Tom Lane 66cd815063 Clean up initdb's error handling so that it prints something more
useful than just \'failed\' when there's a problem.  Per gripe from
Chris Albertson.

In an unrelated change, use VACUUM FULL; VACUUM FREEZE; rather than
a single VACUUM FULL FREEZE command, to respond to my worries of a
couple days ago about the reliability of doing this in one go.
2004-11-29 03:05:03 +00:00
Bruce Momjian ee814b4511 Have initdb display relative paths to start postmaster if used to invoke
initdb, and display in a path-native way.
2004-11-29 01:14:45 +00:00
Tom Lane 90c3ebe4d7 Fix HAVE_OPTRESET to be HAVE_INT_OPTRESET. Typos spotted by Lorne Sunley. 2004-11-27 18:51:08 +00:00
Tom Lane f6474586ea Use English-style quotes in error messages, per Serguei Mokhov. 2004-11-14 23:36:53 +00:00
Peter Eisentraut e9c05281b5 Get rid of perror(), substitute some better phrased error messages.
malloc() doesn't set errno, so most uses were buggy anyway.
2004-11-09 15:57:57 +00:00
Tom Lane 85b2facdd8 Write config files as text not binary, per Magnus Hagander. 2004-10-24 15:55:29 +00:00
Tom Lane 521408a56f Don't use LC_MESSAGES value on WIN32, since it doesn't work.
Magnus Hagander
2004-10-22 22:30:57 +00:00
Peter Eisentraut 63d4f1cdbf Adjust message 2004-10-17 21:04:41 +00:00
Bruce Momjian a49f6ad014 Add full path in error report for version mismatch of binaries. 2004-10-15 04:32:28 +00:00
Peter Eisentraut 0fd37839d9 Message style revisions 2004-10-12 21:54:45 +00:00
Neil Conway 0e72b9d440 Cosmetic improvements/code cleanup:
- replace some function signatures of the form "some_type foo()" with
"some_type foo(void)"
- replace a few instances of a literal 0 being used as a NULL pointer;
there are more instances of this in the code, but I just fixed a few
- in src/backend/utils/mb/wstrncmp.c, replace K&R style function
declarations with ANSI style, remove use of 'register' keyword
- remove an "extern" modifier that was applied to a function definition
(rather than a declaration)
2004-10-10 23:37:45 +00:00
Tom Lane 6a640d1e02 Add missing null terminator to escaped string; clean up unnecessarily
obscurantist coding conventions.
2004-10-07 18:57:26 +00:00
Bruce Momjian 6d46ea25f2 Add one more byte to malloc for null storage. 2004-10-07 17:29:12 +00:00
Bruce Momjian d1cee5495a Escape single quotes and backslashes used in locales placed in
postgresql.conf.

Zhong Xubin
2004-10-07 16:53:25 +00:00
Bruce Momjian 4542581bf1 Adjustment to test on unix domain socket variable for pg_hba.conf
default settings, rather than just Win32.
2004-10-06 09:13:10 +00:00
Bruce Momjian c93872d891 Remove pg_hba.conf 'local' line for Win32 because it doesn't support unix domain
connections.

Andrew Dunstan
2004-10-06 09:01:18 +00:00
Tom Lane a28961d5e0 Spelling correction, per Greg Mullane. 2004-09-02 17:58:41 +00:00
Bruce Momjian b6b71b85bc Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
Bruce Momjian da9a8649d8 Update copyright to 2004. 2004-08-29 04:13:13 +00:00
Tom Lane 7584194cc9 Fix typo in comment, per Andrew Dunstan. 2004-08-25 20:07:57 +00:00
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