summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2007-07-16Add comments spelling out why it's a good idea to release multipleTom Lane
partition locks in reverse order.
2007-07-16With the native compiler on Unixware, disable optimization ifNeil Conway
--enable-debug is used, to avoid complaints about debugging and optimization being mutually exclusive. Patch from Stefan Kaltenbrunner.
2007-07-16Allow plpgsql function parameter names to be qualified with the function'sTom Lane
name. With this patch, it is always possible for the user to qualify a plpgsql variable name if needed to avoid ambiguity. While there is much more work to be done in this area, this simple change removes one unnecessary incompatibility with Oracle. Per discussion.
2007-07-16Hmm, so evidently _check_lock and _clear_lock take an argument of typeTom Lane
int not unsigned int. Third try to get grebe building without warnings...
2007-07-16So our reward for including <sys/atomic_op.h> seems to be a bunch ofTom Lane
nattering about casting away volatile. Losers.
2007-07-16On AIX, include <sys/atomic_op.h> so that the functions we use forTom Lane
TAS support are properly declared.
2007-07-15Because plpgsql's scanner uses %option case-insensitive, flex's results couldTom Lane
theoretically vary depending on what the compile-time locale setting is. Hence, force it to see LC_CTYPE=C to ensure consistent build results. (It's likely that this makes no difference in practice, since our specification for "identifier" surely includes both ends of any possible uppercase/lowercase pair anyway. But it should silence warnings about ambiguous character classes that are reported by some buildfarm members.)
2007-07-15Reject zero or negative BY step in plpgsql integer FOR-loops, and behaveTom Lane
sanely if the loop value overflows int32 on the way to the end value. Avoid useless computation of "SELECT 1" when BY is omitted. Avoid some type-punning between Datum and int4 that dates from the original coding.
2007-07-13Volatile-qualify a dozen variables in plpython.c to eliminate warningsTom Lane
from old versions of gcc. It's not clear to me that this is really necessary for correctness, but less warnings are always good. Per buildfarm results and local testing.
2007-07-13Fix map_sql_typecoll_to_xmlschema_types() to not fail on droppedTom Lane
columns, per my gripe earlier today. Make it look a bit less like someone's first effort at backend coding.
2007-07-13Add casts to suppress warnings about m68k-specific kluge in fmgr.c.Tom Lane
2007-07-12Fix a portability bug (ye olde not casting a <ctype.h> argument toTom Lane
unsigned char). Fortunately we still have buildfarm machines that will flag this. Seems to be new in CVS HEAD, so no backpatch.
2007-07-12Get dirmod.c on the same page as port.h about whether we use pgsymlinkTom Lane
on Cygwin (answer: we don't). Also try to unwind the #ifdef spaghetti a little bit. Untested but hopefully I didn't break anything.
2007-07-12Fixup the indentation of a comment that was mangled by pgindent, andNeil Conway
add dashes to the start/end of the comment block to try to prevent this happening in the future.
2007-07-12Suppress Sun Studio warnings, per Stefan.Tom Lane
2007-07-12Suppress an integer-overflow warning.Tom Lane
2007-07-12Some of our port-specific dynloader implementations are careful toTom Lane
define pg_dlsym() as returning a PGFunction pointer, not just any pointer-to-function. But many are not. Suppress compiler warnings on platforms that aren't careful by inserting explicit casts at the two call sites that didn't have a cast already. Per Stefan.
2007-07-12Compute max and min int8 values using unsigned arithmetic, in hopes ofTom Lane
suppressing Sun Studio compiler warnings. Per Stefan.
2007-07-12Fix some warnings (probably actual bugs) generated by new GSSAPI codeTom Lane
when built on a 64-bit machine. Per buildfarm results extracted by Stefan.
2007-07-12Fix mistaken Assert in adjust_appendrel_attr_needed, per Greg Stark.Tom Lane
2007-07-12Silence compile warning on win32, per Stefan and Buildfarm.Magnus Hagander
2007-07-12Enable GSSAPI to build using MSVC. Always build GSSAPI when Kerberos isMagnus Hagander
enabled, because the only Kerberos library supported always contains it.
2007-07-12Support GSSAPI builds where the header is <gssapi.h> and not <gssapi/gssapi.h>,Magnus Hagander
such as OpenBSD (possibly all Heimdal). Stefan Kaltenbrunner
2007-07-12Fix freenig of names in Kerberos when using MIT - need to use theMagnus Hagander
free function provided in the Kerberos library. This fixes a very hard to track down heap corruption on windows when using debug runtimes.
2007-07-11Suppress a warning that some versions of gcc emit about %x in strftime.Tom Lane
Per suggestion from Alvaro.
2007-07-11A bunch of GSSAPI fixes per comments from Tom:Magnus Hagander
* use elog not ereport for debug * fix debug levels for some output * properly check for memory allocation errors in a couple of missed places
2007-07-10Fix misspelling.Tom Lane
2007-07-10Add support for GSSAPI authentication.Magnus Hagander
Documentation still being written, will be committed later. Henry B. Hotz and Magnus Hagander
2007-07-10Adjust processSQLNamePattern() so that $ within the pattern is always matchedTom Lane
literally, whether quoted or not. Since we allow $ as a character within identifiers, this behavior is useful, whereas the previous behavior of treating it as the regexp ending anchor was nearly useless given that the pattern is automatically anchored anyway. This affects the arguments of psql's \d commands as well as pg_dump's -n and -t switches. Per discussion.
2007-07-09Fix stddev_pop(numeric) and var_pop(numeric), which were incorrectly producingTom Lane
the same outputs as stddev_samp() and var_samp() respectively.
2007-07-09Fix single-user mode so that interrupts (particularly SIGTERM andTom Lane
SIGQUIT) will be recognized and processed while waiting for input, rather than only after something has been typed. Also make SIGQUIT do the same thing as SIGTERM in single-user mode, ie, do a normal shutdown and exit. Since it's relatively easy to provoke SIGQUIT from the keyboard, people may try that instead of control-D, and we'd rather this leads to orderly shutdown. Per report from Leon Mergen and subsequent discussion.
2007-07-08Remove the pgstat_drop_relation() call from smgr_internal_unlink(), becauseTom Lane
we don't know at that point which relation OID to tell pgstat to forget. The code was passing the relfilenode, which is incorrect, and could possibly cause some other relation's stats to be zeroed out. While we could try to clean this up, it seems much simpler and more reliable to let the next invocation of pgstat_vacuum_tabstat() fix things; which indeed is how it worked before I introduced the buggy code into 8.1.3 and later :-(. Problem noticed by Itagaki Takahiro, fix is per subsequent discussion.
2007-07-08Get rid of client-code dependencies on the exact text of the no-passwordTom Lane
error message, by using PQconnectionUsedPassword() instead. Someday we might be able to localize that error message, but not until this coding technique has disappeared everywhere.
2007-07-08Closer code review for PQconnectionUsedPassword() patch: in particular,Tom Lane
not OK to include postgres_fe.h into libpq-fe.h, hence declare it as returning int not bool.
2007-07-08Arrange for the authentication request type to be preserved inJoe Conway
PGconn. Invent a new libpq connection-status function, PQconnectionUsedPassword() that returns true if the server demanded a password during authentication, false otherwise. This may be useful to clients in general, but is immediately useful to help plug a privilege escalation path in dblink. Per list discussion and design proposed by Tom Lane.
2007-07-07Fix a couple of planner bugs introduced by the new ability to discardTom Lane
ORDER BY <constant> as redundant. One is that this means query_planner() has to canonicalize pathkeys even when the query jointree is empty; the canonicalization was always a no-op in such cases before, but no more. Also, we have to guard against thinking that a set-returning function is "constant" for this purpose. Add a couple of regression tests for these evidently under-tested cases. Per report from Greg Stark and subsequent experimentation.
2007-07-07Move parse.h into src/backend on msvc, which is where it is on Unix.Magnus Hagander
Fixes builds from tarballs where the file is pre-generated. Yoshiyuki Asaba
2007-07-06Fix up hash functions for datetime datatypes so that they don't takeTom Lane
unwarranted liberties with int8 vs float8 values for these types. Specifically, be sure to apply either hashint8 or hashfloat8 depending on HAVE_INT64_TIMESTAMP. Per my gripe of even date.
2007-07-03Fix incorrect comment about the timing of AbsorbFsyncRequests() duringTom Lane
checkpoint. The comment claimed that we could do this anytime after setting the checkpoint REDO point, but actually BufferSync is relying on the assumption that buffers dumped by other backends will be fsync'd too. So we really could not do it any sooner than we are doing it.
2007-07-03Add ALTER VIEW ... RENAME TO, and a RENAME TO clause to ALTER SEQUENCE.Neil Conway
Sequences and views could previously be renamed using ALTER TABLE, but this was a repeated source of confusion for users. Update the docs, and psql tab completion. Patch from David Fetter; various minor fixes by myself.
2007-07-02- Fix the -w (wait) option to work in Windows service mode, per bug #3382.Magnus Hagander
- Prevent the -w option being passed to the postmaster. - Read the postmaster options file when starting as a Windows service. Dave Page
2007-07-02Fix failure to restart Postgres when Linux kernel returns EIDRM for shmctl().Tom Lane
This is a Linux kernel bug that apparently exists in every extant kernel version: sometimes shmctl() will fail with EIDRM when EINVAL is correct. We were assuming that EIDRM indicates a possible conflict with pre-existing backends, and refusing to start the postmaster when this happens. Fortunately, there does not seem to be any case where Linux can legitimately return EIDRM (it doesn't track shmem segments in a way that would allow that), so we can get away with just assuming that EIDRM means EINVAL on this platform. Per reports from Michael Fuhr and Jon Lapham --- it's a bit surprising we have not seen more reports, actually.
2007-07-01Add notes about configuring Visual Studio Express for use with theMagnus Hagander
Platform SDK.
2007-07-01Reduce the maximum sleep interval in the autovac launcher to 1 second,Tom Lane
so that it responds to SIGQUIT reasonably promptly even on machines where SA_RESTART signals restart a sleep from scratch. (This whole area could stand some rethinking, but for now make it work like the other processes do.) Also some marginal stylistic cleanups.
2007-07-01Treat the autovac launcher more like a regular backend, in that we waitTom Lane
for it to die before telling the bgwriter to initiate shutdown checkpoint. Since it's connected to shared memory, this seems more prudent than the alternative of letting it quit asynchronously. Resolves my complaint of yesterday about repeated shutdown checkpoints in CVS HEAD.
2007-07-01Avoid memory leakage when a series of subtransactions invoke AFTER triggersTom Lane
that are fired at end-of-statement (as is the normal case for foreign keys, for example). In this situation the per-subxact deferred trigger context is always empty when subtransaction exit is reached; so we could free it, but were not doing so, leading to an intratransaction leak of 8K or more per subtransaction. Per off-list example from Viatcheslav Kalinin subsequent to bug #3418 (his original bug report omitted a foreign key constraint needed to cause this leak). Back-patch to 8.2; prior versions were not using per-subxact contexts for deferred triggers, so did not have this leak.
2007-07-01Fix comments not updated in recent patch.Tom Lane
2007-07-01Add 'volatile' to suppress 'variable might be clobbered by longjmp'Tom Lane
warning emitted by some versions of gcc.
2007-06-30Improve logging of checkpoints. Patch by Greg Smith, worked overTom Lane
by Heikki and a little bit by me.
2007-06-30Avoid crash in interrupted autovacuum worker, caused by leaving the currentAlvaro Herrera
memory context pointing at a context not long lived enough. Also, create a fake PortalContext where to store the vac_context, if only to avoid having it be a top-level memory context.