Commit Graph

31889 Commits

Author SHA1 Message Date
Peter Eisentraut 8d89549380 Update config.guess and config.sub 2011-05-19 22:14:56 +03:00
Peter Eisentraut bb46d42859 Consistent spacing for lengthy error messages
Also, we removed the display of the current value of
max_connections/MaxBackends from some messages earlier, because it was
confusing, so do that in the remaining one as well.
2011-05-19 21:38:24 +03:00
Magnus Hagander a937b07121 Add example for replication in pg_hba.conf
Selena Deckelmann
2011-05-19 14:03:15 -04:00
Robert Haas 74aaa2136d Fix race condition in CheckTargetForConflictsIn.
Dan Ports
2011-05-19 12:12:04 -04:00
Alvaro Herrera 6b449d9051 Fix declaration of $_TD in "strict" trigger functions
This was broken in commit ef19dc6d39 by
the Bunce/Hunsaker/Dunstan team, which moved the declaration from
plperl_create_sub to plperl_call_perl_trigger_func.  This doesn't
actually work because the validator code would not find the variable
declared; and even if you manage to get past the validator, it still
doesn't work because get_sv("_TD", GV_ADD) doesn't have the expected
effect.  The only reason this got beyond testing is that it only fails
in strict mode.

We need to declare it as a global just like %_SHARED; it is simpler than
trying to actually do what the patch initially intended, and is said to
have the same performance benefit.

As a more serious issue, fix $_TD not being properly local()ized,
meaning nested trigger functions would clobber $_TD.

Alex Hunsaker, per test report from Greg Mullane
2011-05-18 23:56:18 -04:00
Heikki Linnakangas ea896da394 Replace strdup() with pstrdup(), to avoid leaking memory.
It's been like this since the seg module was introduced, so backpatch to
8.2 which is the oldest supported version.
2011-05-18 22:49:22 -04:00
Bruce Momjian 1f35944607 In pg_upgrade, clean up handling of invalid directory specification by
checking the stat() errno value more strictly.
2011-05-18 22:22:40 -04:00
Bruce Momjian 772a5f1e5b Improve pg_upgrade error reporting if the bin or data directories do not
exist or are not directories.
2011-05-18 18:37:25 -04:00
Peter Eisentraut 4a6a5c86db Remove obsolete comment 2011-05-19 01:19:57 +03:00
Peter Eisentraut c13dc6402b Spell checking and markup refinement 2011-05-19 01:14:45 +03:00
Peter Eisentraut 0ee391b77a /contrib/foo -> contrib/foo
Since contrib is a relative directory specification, a leading slash
is inappropriate.
2011-05-19 00:30:31 +03:00
Bruce Momjian 92ff915018 Improve pg_upgrade X_OK comment. 2011-05-18 12:25:34 -04:00
Bruce Momjian 6fbf4e0e7c Fix pg_upgrade build problem on Windows when using X_OK access
permission check on the current directory.
2011-05-18 12:13:37 -04:00
Tom Lane b3bc63efbc Fix pg_dump's handling of extension-member casts and languages.
pg_dump has some heuristic rules for whether to dump casts and procedural
languages, since it's not all that easy to distinguish built-in ones from
user-defined ones.  However, we should not apply those rules to objects
that belong to an extension, but just use the perfectly well-defined rules
for what to do with extension member objects.  Otherwise we might
mistakenly lose extension member objects during a binary upgrade (which is
the only time that we'd want to dump extension members).
2011-05-16 16:41:52 -04:00
Bruce Momjian e728701fb4 Update pg_upgrade directory check error message. 2011-05-16 12:32:36 -04:00
Bruce Momjian 8a849cdee4 Remove redundant privilege doc sentences. 2011-05-16 11:22:25 -04:00
Bruce Momjian bda27e502f Add pg_upgrade check to make sure the user has full access permission in
the current directory;  if not, throw an error.
2011-05-16 11:01:29 -04:00
Bruce Momjian 6c19bd96bc Allow pg_upgrade to honor libpq environment variables. Add 'local'
checks for PGHOST and PGHOSTADDR.
2011-05-16 10:48:40 -04:00
Andrew Dunstan 78b66cff72 Quote isolationtester command name so Windows will not think dot is the command. 2011-05-15 23:42:12 -04:00
Andrew Dunstan df15d11cb5 Add required psqldir setting for isolation checks. 2011-05-15 23:12:36 -04:00
Andrew Dunstan ec645ef346 Fix bad macro call noticed by MSVC compiler. 2011-05-15 18:45:26 -04:00
Andrew Dunstan 20bacc9560 Add missing check function lookup. 2011-05-15 18:03:19 -04:00
Andrew Dunstan 840826e36c Build and run isolation test programs under MSVC. 2011-05-15 17:55:05 -04:00
Robert Haas 9bb6d97952 More cleanup of FOREIGN TABLE permissions handling.
This commit fixes psql, pg_dump, and the information schema to be
consistent with the backend changes which I made as part of commit
be90032e0d, and also includes a
related documentation tweak.

Shigeru Hanada, with slight adjustment.
2011-05-13 15:51:03 -04:00
Robert Haas c5ab8425be Kill stray "not". 2011-05-12 17:10:30 -04:00
Tom Lane 8d0df2048f Fix write-past-buffer-end in ldapServiceLookup().
The code to assemble ldap_get_values_len's output into a single string
wrote the terminating null one byte past where it should.  Fix that,
and make some other cosmetic adjustments to make the code a trifle more
readable and more in line with usual Postgres coding style.

Also, free the "result" string when done with it, to avoid a permanent
memory leak.

Bug report and patch by Albe Laurenz, cosmetic adjustments by me.
2011-05-12 11:56:38 -04:00
Alvaro Herrera c6eb5740b3 Fix assorted typos 2011-05-12 08:52:56 -04:00
Tom Lane e05b866447 Split PGC_S_DEFAULT into two values, for true boot_val vs computed default.
Failure to distinguish these cases is the real cause behind the recent
reports of Windows builds crashing on 'infinity'::timestamp, which was
directly due to failure to establish a value of timezone_abbreviations
in postmaster child processes.  The postmaster had the desired value,
but write_one_nondefault_variable() didn't transmit it to backends.

To fix that, invent a new value PGC_S_DYNAMIC_DEFAULT, and be sure to use
that or PGC_S_ENV_VAR (as appropriate) for "default" settings that are
computed during initialization.  (We need both because there's at least
one variable that could receive a value from either source.)

This commit also fixes ProcessConfigFile's failure to restore the correct
default value for certain GUC variables if they are set in postgresql.conf
and then removed/commented out of the file.  We have to recompute and
reinstall the value for any GUC variable that could have received a value
from PGC_S_DYNAMIC_DEFAULT or PGC_S_ENV_VAR sources, and there were a
number of oversights.  (That whole thing is a crock that needs to be
redesigned, but not today.)

However, I intentionally didn't make it work "exactly right" for the cases
of timezone and log_timezone.  The exactly right behavior would involve
running select_default_timezone, which we'd have to do independently in
each postgres process, causing the whole database to become entirely
unresponsive for as much as several seconds.  That didn't seem like a good
idea, especially since the variable's removal from postgresql.conf might be
just an accidental edit.  Instead the behavior is to adopt the previously
active setting as if it were default.

Note that this patch creates an ABI break for extensions that use any of
the PGC_S_XXX constants; they'll need to be recompiled.
2011-05-11 19:57:38 -04:00
Tom Lane 6fc6686b48 Clean up parsing of CREATE TRIGGER's argument list.
Use ColLabel in place of ColId, so that reserved words are accepted as if
they were not reserved.  Also, remove BCONST and XCONST, which were never
documented as allowed.  Allowing those exposes to users an implementation
detail, namely the format in which the lexer outputs such constants, that
seems unwise to expose.

No documentation change needed, since this just makes the code act more
like you'd expect from reading the CREATE TRIGGER man page.

Per complaint from Szymon Guz and subsequent discussion.
2011-05-11 14:43:01 -04:00
Heikki Linnakangas a0c8514149 Shut down WAL receiver if it's still running at end of recovery. We used to
just check that it's not running and PANIC if it was, but that can rightfully
happen if recovery stops at recovery target.
2011-05-11 12:46:08 +03:00
Tom Lane ea964a451e Be more explicit about the meaning of the change in standard_conforming_strings. 2011-05-10 23:44:33 -04:00
Bruce Momjian 64cc297dc9 Mention "backslash" escape processing change in 9.1 release notes. 2011-05-10 20:57:19 -04:00
Tom Lane 2e82d0b396 Prevent datebsearch() from crashing on base == NULL && nel == 0.
Normally nel == 0 works okay because the initial value of "last" will be
less than "base"; but if "base" is zero then the calculation wraps around
and we have a very large (unsigned) value for "last", so that the loop can
be entered and we get a SIGSEGV on a bogus pointer.

This is certainly the proximate cause of the recent reports of Windows
builds crashing on 'infinity'::timestamp --- evidently, they're either not
setting an active timezonetktbl, or setting an empty one.  It's not yet
clear to me why it's only happening on Windows and not happening on any
buildfarm member.  But even if that's due to some bug elsewhere, it seems
wise for this function to not choke on the powerup values of
timezonetktbl/sztimezonetktbl.

I also changed the copy of this code in ecpglib, although I am not sure
whether it's exposed to a similar hazard.

Per report and stack trace from Richard Broersma.
2011-05-10 20:37:26 -04:00
Bruce Momjian 7ff7711919 For create/dropdb, only connect once to the server since we now have a
shared description table for pg_database comments.

Also update comments about database name selection.
2011-05-10 19:44:47 -04:00
Peter Eisentraut 87631ac98d Add some punctuation 2011-05-10 22:37:50 +03:00
Peter Eisentraut df6d033197 Put options in more alphabetical order 2011-05-10 22:37:22 +03:00
Peter Eisentraut 94a8fde403 Put options help in alphabetical order 2011-05-10 21:48:07 +03:00
Peter Eisentraut 00fad9f6fe Format pg_upgrade --version in line with conventions 2011-05-10 21:40:29 +03:00
Peter Eisentraut 4c78846cb3 Add bug report line to pg_upgrade --help output 2011-05-10 21:37:55 +03:00
Peter Eisentraut 3a8dcd9a1f Put pg_test_fsync --help and --version output in line with conventions
Foremost, it should go to stdout.
2011-05-10 21:34:26 +03:00
Tom Lane 1453cd8f82 Adjust documentation with respect to "unknown" timezone setting.
The recent cleanup of GUC assign hooks got rid of the kludge of using
"unknown" as a magic value for timezone and log_timezone.  But I forgot
to update the documentation to match, as noted by Martin Pitt.
2011-05-10 13:48:40 -04:00
Tom Lane 853c1750f9 Be more wary in initdb's creation of platform-dependent collations.
Discard any collation aliases that match the built-in pg_collation entries
(ie, "default", "C", "POSIX").  Such aliases would be refused by a CREATE
COLLATION command, but since initdb is injecting them via a simple INSERT,
it has to make the corresponding check for itself.  Per Martin Pitt's
report of funny behavior in a machine that had a bogus "C.UTF-8" locale.

Also, use E'' syntax for the output of escape_quotes, as per its header
comment.
2011-05-10 12:08:47 -04:00
Bruce Momjian 5059cf6ebf In pg_upgrade, remove suggestion of setting pg_hba.conf to 'trust', now
that we report the libpq connection failure string.  Per suggestion from
Robert Haas.
2011-05-10 10:42:43 -04:00
Bruce Momjian a9cc9df021 Documentation cleanup for the possible values of the datatype 'boolean'. 2011-05-09 23:25:16 -04:00
Bruce Momjian 832c095d68 Update documentation to state there is three-value logic, not
three-value boolean logic.

Backpatch to 9.0.X since we just got another bug report about this
today.
2011-05-09 21:04:18 -04:00
Tom Lane 7886cc73ad Remove "make check" target in src/test/isolation/Makefile.
This doesn't work as expected because the isolationtester program requires
libpq to already be installed.  While it works when you've already installed
libpq, having to already have done "make install" defeats most of the point
of a check with a temp installation.  And there are weird corner cases if
the dynamic linker picks up an old libpq.so from system library directories.
Remove the target (or more precisely, make it print a helpful message) so
people don't expect the case to work.
2011-05-09 11:00:30 -04:00
Bruce Momjian 78318d63d7 In pg_upgrade, add status message about superuser check. 2011-05-09 08:55:36 -04:00
Bruce Momjian 76e5b4c85d Add C comment about the fact that the autovacuum limit can go backwards
by 3, but that is it OK.
2011-05-08 23:59:31 -04:00
Tom Lane eff223ffd7 Fix some portability issues in isolation regression test driver.
Remove random system #includes in favor of using postgres_fe.h.  (The
alternative to that is letting this module grow its own configuration
testing ability...)

Also fix the "make clean" target to actually clean things up.

Per local testing.
2011-05-08 19:45:00 -04:00
Bruce Momjian e6a7402842 Add C comment why client encoding can be set in pg_upgrade. 2011-05-07 22:30:35 -04:00