Commit Graph

108 Commits

Author SHA1 Message Date
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