Commit Graph

123 Commits

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