summaryrefslogtreecommitdiff
path: root/src/include
AgeCommit message (Collapse)Author
2008-11-26Rely on relcache invalidation to update the cached size of the FSM.Heikki Linnakangas
2008-11-25Use ResourceOwners in the snapshot manager, instead of attempting to track themAlvaro Herrera
by hand. As an added bonus, the new code is smaller and more understandable, and the ugly loops are gone. This had been discussed all along but never implemented. It became clear that it really needed to be fixed after a bug report by Pavan Deolasee.
2008-11-24Add support for matching wildcard server certificates to the new SSL code.Magnus Hagander
This uses the function fnmatch() which is not available on all platforms (notably Windows), so import the implementation from NetBSD into src/port.
2008-11-24CLUSTER VERBOSE and corresponding clusterdb --verbose optionPeter Eisentraut
Jim Cox and Peter Eisentraut
2008-11-22Switch the planner over to treating qualifications of a JOIN_SEMI join asTom Lane
though it is an inner rather than outer join type. This essentially means that we don't bother to separate "pushed down" qual conditions from actual join quals at a semijoin plan node; which is okay because the restrictions of SQL syntax make it impossible to have a pushed-down qual that references the inner side of a semijoin. This allows noticeably better optimization of IN/EXISTS cases than we had before, since the equivalence-class machinery can now use those quals. Also fix a couple of other mistakes that had essentially disabled the ability to unique-ify the inner relation and then join it to just a subset of the left-hand relations. An example case using the regression database is select * from tenk1 a, tenk1 b where (a.unique1,b.unique2) in (select unique1,unique2 from tenk1 c); which is planned reasonably well by 8.3 and earlier but had been forcing a cartesian join of a/b in CVS HEAD.
2008-11-21Make the enumvals column of pg_settings be text[] instead of justMagnus Hagander
a comma separated string.
2008-11-20Add support for using SSL client certificates to authenticate to theMagnus Hagander
database (only for SSL connections, obviously).
2008-11-20Control client certificate requesting with the pg_hba option "clientcert"Magnus Hagander
instead of just relying on the root certificate file to be present.
2008-11-19Rethink the way FSM truncation works. Instead of WAL-logging FSMHeikki Linnakangas
truncations in FSM code, call FreeSpaceMapTruncateRel from smgr_redo. To make that cleaner from modularity point of view, move the WAL-logging one level up to RelationTruncate, and move RelationTruncate and all the related WAL-logging to new src/backend/catalog/storage.c file. Introduce new RelationCreateStorage and RelationDropStorage functions that are used instead of calling smgrcreate/smgrscheduleunlink directly. Move the pending rel deletion stuff from smgrcreate/smgrscheduleunlink to the new functions. This leaves smgr.c as a thin wrapper around md.c; all the transactional stuff is now in storage.c. This will make it easier to add new forks with similar truncation logic, like the visibility map.
2008-11-19Some infrastructure changes for the upcoming auto-explain contrib module:Tom Lane
* Refactor explain.c slightly to export a convenient-to-use subroutine for printing EXPLAIN results. * Provide hooks for plugins to get control at ExecutorStart and ExecutorEnd as well as ExecutorRun. * Add some minimal support for tracking the total runtime of ExecutorRun. This code won't actually do anything unless a plugin prods it to. * Change the API of the DefineCustomXXXVariable functions to allow nonzero "flags" to be specified for a custom GUC variable. While at it, also make the "bootstrap" default value for custom GUCs be explicitly specified as a parameter to these functions. This is to eliminate confusion over where the default comes from, as has been expressed in the past by some users of the custom-variable facility. * Refactor GUC code a bit to ensure that a custom variable gets initialized to something valid (like its default value) even if the placeholder value was invalid.
2008-11-18Ident authentication over Unix-domain sockets on Solaris, usingPeter Eisentraut
getpeerucred() function. Author: Garick Hamlin <ghamlin@isc.upenn.edu>
2008-11-16Modify UPDATE/DELETE WHERE CURRENT OF to use the FOR UPDATE infrastructure toTom Lane
locate the target row, if the cursor was declared with FOR UPDATE or FOR SHARE. This approach is more flexible and reliable than digging through the plan tree; for instance it can cope with join cursors. But we still provide the old code for use with non-FOR-UPDATE cursors. Per gripe from Robert Haas.
2008-11-15Make SELECT FOR UPDATE/SHARE work on inheritance trees, by having the planTom Lane
return the tableoid as well as the ctid for any FOR UPDATE targets that have child tables. All child tables are listed in the ExecRowMark list, but the executor just skips the ones that didn't produce the current row. Curiously, this longstanding restriction doesn't seem to have been documented anywhere; so no doc changes.
2008-11-14Second try at fixing DLLIMPORT problem for pg_crc.h on Cygwin.Tom Lane
2008-11-14Actually, instead of whining about how type internal might not safely storeTom Lane
a pointer, why don't we just fix that. Every known use of "internal" really means a pointer anyway.
2008-11-14Replace the usage of heap_addheader to create pg_attribute tuples with regularAlvaro Herrera
heap_form_tuple. Since this removes the last remaining caller of heap_addheader, remove it. Extracted from the column privileges patch from Stephen Frost, with further code cleanups by me.
2008-11-14Implement the basic form of UNNEST, ie unnest(anyarray) returns setofTom Lane
anyelement. This lacks the WITH ORDINALITY option, as well as the multiple input arrays option added in the most recent SQL specs. But it's still a pretty useful subset of the spec's functionality, and it is enough to allow obsoleting contrib/intagg.
2008-11-13Prevent synchronous scan during GIN index build, because GIN is optimizedTom Lane
for inserting tuples in increasing TID order. It's not clear whether this fully explains Ivan Sergio Borgonovo's complaint, but simple testing confirms that a scan that doesn't start at block 0 can slow GIN build by a factor of three or four. Backpatch to 8.3. Sync scan didn't exist before that.
2008-11-13array_agg aggregate function, as per SQL:2008, but without ORDER BY clausePeter Eisentraut
Rearrange the documentation a bit now that array_agg and xmlagg have similar semantics and issues. best of Robert Haas, Jeff Davis, Peter Eisentraut
2008-11-13PGDLLIMPORT-ize the global variables referenced in pg_crc.h.Tom Lane
I think this will fix current mingw buildfarm failures for pg_trgm.
2008-11-12Update URL to Ross Williams' CRC paper.Alvaro Herrera
Per note from Devrim Gunduz
2008-11-12If we're going to use a SQL function for this, at least make it schema-proof.Tom Lane
2008-11-12array_length() function, and for SQL compatibility also cardinality()Peter Eisentraut
function as a special case. This version still has the suspicious behavior of returning null for an empty array (rather than zero), but this may need a wholesale revision of empty array behavior, currently under discussion. Jim Nasby, Robert Haas, Peter Eisentraut
2008-11-11Get rid of adjust_appendrel_attr_needed(), which has been broken ever sinceTom Lane
we extended the appendrel mechanism to support UNION ALL optimization. The reason nobody noticed was that we are not actually using attr_needed data for appendrel children; hence it seems more reasonable to rip it out than fix it. Back-patch to 8.2 because an Assert failure is possible in corner cases. Per examination of an example from Jim Nasby. In HEAD, also get rid of AppendRelInfo.col_mappings, which is quite inadequate to represent UNION ALL situations; depend entirely on translated_vars instead.
2008-11-11Add support for input and output of interval values formatted per ISO 8601;Tom Lane
specifically, we can input either the "format with designators" or the "alternative format", and we can output the former when IntervalStyle is set to iso_8601. Ron Mayer
2008-11-10Make relhasrules and relhastriggers work like relhasindex, namely we letTom Lane
VACUUM reset them to false rather than trying to clean 'em up during DROP.
2008-11-09Replace pg_class.reltriggers with relhastriggers, which is just a boolean hintTom Lane
("there might be triggers") rather than an exact count. This is necessary catalog infrastructure for the upcoming patch to reduce the strength of locking needed for trigger addition/removal. Split out and committed separately for ease of reviewing/testing. In passing, also get rid of the unused pg_class columns relukeys, relfkeys, and relrefs, which haven't been maintained in many years and now have no chance of ever being maintained (because of wishing to avoid locking). Simon Riggs
2008-11-09Add a new GUC variable called "IntervalStyle" that decouples interval outputTom Lane
from DateStyle, and create a new interval style that produces output matching the SQL standard (at least for interval values that fall within the standard's restrictions). IntervalStyle is also used to resolve the conflict between the standard and traditional Postgres rules for interpreting negative interval input. Ron Mayer
2008-11-07Implement ALTER DATABASE SET TABLESPACE to move a whole database (or at leastTom Lane
as much of it as lives in its default tablespace) to a new tablespace. Guillaume Lelarge, with some help from Bernd Helmle and Tom Lane
2008-11-06Improve bulk-insert performance by keeping the current target buffer pinnedTom Lane
(but not locked, as that would risk deadlocks). Also, make it work in a small ring of buffers to avoid having bulk inserts trash the whole buffer arena. Robert Haas, after an idea of Simon Riggs'.
2008-11-04ADD array_ndims functionPeter Eisentraut
Author: Robert Haas <robertmhaas@gmail.com>
2008-11-03Dept of second thoughts: seems it'd be safer if pg_typeof is markedTom Lane
stable not immutable, since it depends on system catalog contents.
2008-11-03Clean up the messy semantics (not to mention inefficiency) of PageGetTempPageTom Lane
by splitting it into three functions with better-defined behaviors. Zdenek Kotala
2008-11-03suppress_redundant_updates_trigger function.Andrew Dunstan
2008-11-03Add pg_typeof() function.Tom Lane
Brendan Jurd
2008-11-03Change the pgstat logic so that the stats collector writes the stats file onlyTom Lane
upon requests from backends, rather than on a fixed 500msec cycle. (There's still throttling logic to ensure it writes no more often than once per 500msec, though.) This should result in a significant reduction in stats file write traffic in typical scenarios where the stats are demanded only infrequently. This approach also means that the former difficulty with changing stats_temp_directory on-the-fly has gone away, so remove the caution about that as well as the thrashing we did to minimize the trouble window. In passing, also fix pgstat_report_stat() so that we will send a stats message if we have function call stats but not table stats to report; this fixes a bug in the recent patch to support function-call stats. Martin Pihlak
2008-11-02Remove the last vestiges of the MAKE_PTR/MAKE_OFFSET mechanism. We haven'tTom Lane
allowed different processes to have different addresses for the shmem segment in quite a long time, but there were still a few places left that used the old coding convention. Clean them up to reduce confusion and improve the compiler's ability to detect pointer type mismatches. Kris Jurka
2008-11-02Remove all uses of the deprecated functions heap_formtuple, heap_modifytuple,Tom Lane
and heap_deformtuple in favor of the newer functions heap_form_tuple et al (which do the same things but use bool control flags instead of arbitrary char values). Eliminate the former duplicate coding of these functions, reducing the deprecated functions to mere wrappers around the newer ones. We can't get rid of them entirely because add-on modules probably still contain many instances of the old coding style. Kris Jurka
2008-10-31Simplify ExecutorRun's API and save some trivial number of cycles by havingTom Lane
it just return void instead of sometimes returning a TupleTableSlot. SQL functions don't need that anymore, and noplace else does either. Eliminating the return value also means one less hassle for the ExecutorRun hook functions that will be supported beginning in 8.4.
2008-10-31Update FSM on WAL replay. This is a bit limited; the FSM is only updatedHeikki Linnakangas
on non-full-page-image WAL records, and quite arbitrarily, only if there's less than 20% free space on the page after the insert/update (not on HOT updates, though). The 20% cutoff should avoid most of the overhead, when replaying a bulk insertion, for example, while ensuring that pages that are full are marked as full in the FSM. This is mostly to avoid the nasty worst case scenario, where you replay from a PITR archive, and the FSM information in the base backup is really out of date. If there was a lot of pages that the outdated FSM claims to have free space, but don't actually have any, the first unlucky inserter after the recovery would traverse through all those pages, just to find out that they're full. We didn't have this problem with the old FSM implementation, because we simply threw the FSM information away on a non-clean shutdown.
2008-10-31Allow SQL-language functions to return the output of an INSERT/UPDATE/DELETETom Lane
RETURNING clause, not just a SELECT as formerly. A side effect of this patch is that when a set-returning SQL function is used in a FROM clause, performance is improved because the output is collected into a tuplestore within the function, rather than using the less efficient value-per-call mechanism.
2008-10-31Unite ReadBufferWithFork, ReadBufferWithStrategy, and ZeroOrReadBufferHeikki Linnakangas
functions into one ReadBufferExtended function, that takes the strategy and mode as argument. There's three modes, RBM_NORMAL which is the default used by plain ReadBuffer(), RBM_ZERO, which replaces ZeroOrReadBuffer, and a new mode RBM_ZERO_ON_ERROR, which allows callers to read corrupt pages without throwing an error. The FSM needs the new mode to recover from corrupt pages, which could happend if we crash after extending an FSM file, and the new page is "torn". Add fork number to some error messages in bufmgr.c, that still lacked it.
2008-10-31Add support for user-defined I/O conversion casts.Heikki Linnakangas
2008-10-29Support for Sun Studio compiler on LinuxPeter Eisentraut
This basically takes some build system code that was previously labeled "Solaris" and ties it to the compiler rather than the operating system. Author: Julius Stroffek <Julius.Stroffek@Sun.COM>
2008-10-29Unicode escapes in strings and identifiersPeter Eisentraut
2008-10-29Be more tense about not creating tuplestores with randomAccess = true unlessTom Lane
backwards scan could actually happen. In particular, pass a flag to materialize-mode SRFs that tells them whether they need to require random access. In passing, also suppress unneeded backward-scan overhead for a Portal's holdStore tuplestore. Per my proposal about reducing I/O costs for tuplestores.
2008-10-28Extend ExecMakeFunctionResult() to support set-returning functions that returnTom Lane
via a tuplestore instead of value-per-call. Refactor a few things to reduce ensuing code duplication with nodeFunctionscan.c. This represents the reasonably noncontroversial part of my proposed patch to switch SQL functions over to returning tuplestores. For the moment, SQL functions still do things the old way. However, this change enables PL SRFs to be called in targetlists (observe changes in plperl regression results).
2008-10-28Arrange to squeeze out the MINIMAL_TUPLE_PADDING in the tuple representationTom Lane
written to temp files by tuplesort.c and tuplestore.c. This saves 2 bytes per row for 32-bit machines, and 6 bytes per row for 64-bit machines, which seems worth the slight additional uglification of the tuple read/write routines.
2008-10-28Remove support for (insecure) crypt authentication.Magnus Hagander
This breaks compatibility with pre-7.2 versions.
2008-10-27Install a more robust solution for the problem of infinite error-processingTom Lane
recursion when we are unable to convert a localized error message to the client's encoding. We've been over this ground before, but as reported by Ibrar Ahmed, it still didn't work in the case of conversion failures for the conversion-failure message itself :-(. Fix by installing a "circuit breaker" that disables attempts to localize this message once we get into recursion trouble. Patch all supported branches, because it is in fact broken in all of them; though I had to add some missing translations to the older branches in order to expose the failure in the particular test case I was using.