aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Make replace(), split_part(), and string_to_array() behave somewhat sanelyTom Lane2007-07-19
| | | | | | | | | when handed an invalidly-encoded pattern. The previous coding could get into an infinite loop if pg_mb2wchar_with_len() returned a zero-length string after we'd tested for nonempty pattern; which is exactly what it will do if the string consists only of an incomplete multibyte character. This led to either an out-of-memory error or a backend crash depending on platform. Per report from Wiktor Wodecki.
* Only use the pipe chunking protocol if we know the syslogger shouldAndrew Dunstan2007-07-19
| | | | | | | be catching stderr output, and we are not ourselves the syslogger. Otherwise, go directly to stderr. Bug noticed by Tom Lane. Backpatch as far as 8.0.
* Fix an old thinko in SS_make_initplan_from_plan, which is used when optimizingTom Lane2007-07-18
| | | | | | | | a MIN or MAX aggregate call into an indexscan: the initplan is being made at the current query nesting level and so we shouldn't increment query_level. Though usually harmless, this mistake could lead to bogus "plan should not reference subplan's variable" failures on complex queries. Per bug report from David Sanchez i Gregori.
* Cast NULL to a pointer type in the execl() call, to avoid a compiler warning onAlvaro Herrera2007-07-18
| | | | | some platforms and possibly a bug. Per report from Stefan and subsequent discussion.
* Properly adjust age() seconds to match the sign of the larger units.Bruce Momjian2007-07-18
| | | | Patch from Tom.
* Fix incorrect optimization of foreign-key checks. When an UPDATE on theTom Lane2007-07-17
| | | | | | | | | | | | | | referencing table does not change the tuple's FK column(s), we don't bother to check the PK table since the constraint was presumably already valid. However, the check is still necessary if the tuple was inserted by our own transaction, since in that case the INSERT trigger will conclude it need not make the check (since its version of the tuple has been deleted). We got this right for simple cases, but not when the insert and update are in different subtransactions of the current top-level transaction; in such cases the FK check would never be made at all. (Hence, problem dates back to 8.0 when subtransactions were added --- it's actually the subtransaction version of a bug fixed in 7.3.5.) Fix, and add regression test cases. Report and fix by Affan Salman.
* Implement CREATE TABLE LIKE ... INCLUDING INDEXES. Patch from NikhilS,Neil Conway2007-07-17
| | | | | based in part on an earlier patch from Trevor Hardcastle, and reviewed by myself.
* Fix outfuncs.c to dump A_Const nodes representing NULLs correctly. This hasTom Lane2007-07-17
| | | | | | been broken since forever, but was not noticed because people seldom look at raw parse trees. AFAIK, no impact on users except that debug_print_parse might fail; but patch it all the way back anyway. Per report from Jeff Ross.
* Add comments spelling out why it's a good idea to release multipleTom Lane2007-07-16
| | | | partition locks in reverse order.
* With the native compiler on Unixware, disable optimization ifNeil Conway2007-07-16
| | | | | --enable-debug is used, to avoid complaints about debugging and optimization being mutually exclusive. Patch from Stefan Kaltenbrunner.
* Allow plpgsql function parameter names to be qualified with the function'sTom Lane2007-07-16
| | | | | | | 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.
* Hmm, so evidently _check_lock and _clear_lock take an argument of typeTom Lane2007-07-16
| | | | int not unsigned int. Third try to get grebe building without warnings...
* So our reward for including <sys/atomic_op.h> seems to be a bunch ofTom Lane2007-07-16
| | | | nattering about casting away volatile. Losers.
* On AIX, include <sys/atomic_op.h> so that the functions we use forTom Lane2007-07-16
| | | | TAS support are properly declared.
* Because plpgsql's scanner uses %option case-insensitive, flex's results couldTom Lane2007-07-15
| | | | | | | | | 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.)
* Reject zero or negative BY step in plpgsql integer FOR-loops, and behaveTom Lane2007-07-15
| | | | | | 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.
* Volatile-qualify a dozen variables in plpython.c to eliminate warningsTom Lane2007-07-13
| | | | | | 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.
* Fix map_sql_typecoll_to_xmlschema_types() to not fail on droppedTom Lane2007-07-13
| | | | | columns, per my gripe earlier today. Make it look a bit less like someone's first effort at backend coding.
* Add casts to suppress warnings about m68k-specific kluge in fmgr.c.Tom Lane2007-07-13
|
* Fix a portability bug (ye olde not casting a <ctype.h> argument toTom Lane2007-07-12
| | | | | unsigned char). Fortunately we still have buildfarm machines that will flag this. Seems to be new in CVS HEAD, so no backpatch.
* Get dirmod.c on the same page as port.h about whether we use pgsymlinkTom Lane2007-07-12
| | | | | on Cygwin (answer: we don't). Also try to unwind the #ifdef spaghetti a little bit. Untested but hopefully I didn't break anything.
* Fixup the indentation of a comment that was mangled by pgindent, andNeil Conway2007-07-12
| | | | | add dashes to the start/end of the comment block to try to prevent this happening in the future.
* Suppress Sun Studio warnings, per Stefan.Tom Lane2007-07-12
|
* Suppress an integer-overflow warning.Tom Lane2007-07-12
|
* Some of our port-specific dynloader implementations are careful toTom Lane2007-07-12
| | | | | | | 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.
* Compute max and min int8 values using unsigned arithmetic, in hopes ofTom Lane2007-07-12
| | | | suppressing Sun Studio compiler warnings. Per Stefan.
* Fix some warnings (probably actual bugs) generated by new GSSAPI codeTom Lane2007-07-12
| | | | when built on a 64-bit machine. Per buildfarm results extracted by Stefan.
* Fix mistaken Assert in adjust_appendrel_attr_needed, per Greg Stark.Tom Lane2007-07-12
|
* Silence compile warning on win32, per Stefan and Buildfarm.Magnus Hagander2007-07-12
|
* Enable GSSAPI to build using MSVC. Always build GSSAPI when Kerberos isMagnus Hagander2007-07-12
| | | | enabled, because the only Kerberos library supported always contains it.
* Support GSSAPI builds where the header is <gssapi.h> and not <gssapi/gssapi.h>,Magnus Hagander2007-07-12
| | | | | | such as OpenBSD (possibly all Heimdal). Stefan Kaltenbrunner
* Fix freenig of names in Kerberos when using MIT - need to use theMagnus Hagander2007-07-12
| | | | | | free function provided in the Kerberos library. This fixes a very hard to track down heap corruption on windows when using debug runtimes.
* Suppress a warning that some versions of gcc emit about %x in strftime.Tom Lane2007-07-11
| | | | Per suggestion from Alvaro.
* A bunch of GSSAPI fixes per comments from Tom:Magnus Hagander2007-07-11
| | | | | | * use elog not ereport for debug * fix debug levels for some output * properly check for memory allocation errors in a couple of missed places
* Fix misspelling.Tom Lane2007-07-10
|
* Add support for GSSAPI authentication.Magnus Hagander2007-07-10
| | | | | | Documentation still being written, will be committed later. Henry B. Hotz and Magnus Hagander
* Adjust processSQLNamePattern() so that $ within the pattern is always matchedTom Lane2007-07-10
| | | | | | | | 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.
* Fix stddev_pop(numeric) and var_pop(numeric), which were incorrectly producingTom Lane2007-07-09
| | | | the same outputs as stddev_samp() and var_samp() respectively.
* Fix single-user mode so that interrupts (particularly SIGTERM andTom Lane2007-07-09
| | | | | | | | | | 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.
* Remove the pgstat_drop_relation() call from smgr_internal_unlink(), becauseTom Lane2007-07-08
| | | | | | | | | | 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.
* Get rid of client-code dependencies on the exact text of the no-passwordTom Lane2007-07-08
| | | | | | 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.
* Closer code review for PQconnectionUsedPassword() patch: in particular,Tom Lane2007-07-08
| | | | | not OK to include postgres_fe.h into libpq-fe.h, hence declare it as returning int not bool.
* Arrange for the authentication request type to be preserved inJoe Conway2007-07-08
| | | | | | | | | 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.
* Fix a couple of planner bugs introduced by the new ability to discardTom Lane2007-07-07
| | | | | | | | | | 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.
* Move parse.h into src/backend on msvc, which is where it is on Unix.Magnus Hagander2007-07-07
| | | | | | Fixes builds from tarballs where the file is pre-generated. Yoshiyuki Asaba
* Fix up hash functions for datetime datatypes so that they don't takeTom Lane2007-07-06
| | | | | | 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.
* Fix incorrect comment about the timing of AbsorbFsyncRequests() duringTom Lane2007-07-03
| | | | | | | 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.
* Add ALTER VIEW ... RENAME TO, and a RENAME TO clause to ALTER SEQUENCE.Neil Conway2007-07-03
| | | | | | | 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.
* - Fix the -w (wait) option to work in Windows service mode, per bug #3382.Magnus Hagander2007-07-02
| | | | | | | - Prevent the -w option being passed to the postmaster. - Read the postmaster options file when starting as a Windows service. Dave Page
* Fix failure to restart Postgres when Linux kernel returns EIDRM for shmctl().Tom Lane2007-07-02
| | | | | | | | | | | | | 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.