aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Make psql distinguish between unique indices and unique constraints.Robert Haas2010-08-01
| | | | Josh Kupershmidt. Reviewing and kibitzing by Kevin Grittner and me.
* Tweak tsmatchsel() so that it examines the structure of the tsquery wheneverTom Lane2010-07-31
| | | | | | | | | | | | | | | possible (ie, whenever the tsquery is a constant), even when no statistics are available for the tsvector. For example, foo @@ 'a & b'::tsquery can be expected to be more selective than foo @@ 'a'::tsquery, whether or not we know anything about foo. We use DEFAULT_TS_MATCH_SEL as the assumed selectivity of individual query terms when no stats are available, then combine the terms according to the query's AND/OR structure as usual. Per experimentation with Artur Dabrowski's example. (The fact that there are no stats available in that example is a problem in itself, but nonetheless tsmatchsel should be smarter about the case.) Back-patch to 8.4 to keep all versions of tsmatchsel() in sync.
* Rewrite the key-combination logic in GIN's keyGetItem() and scanGetItem()Tom Lane2010-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | routines to make them behave better in the presence of "lossy" index pointers. The previous coding was outright incorrect for some cases, as recently reported by Artur Dabrowski: scanGetItem would fail to return index entries in cases where one index key had multiple exact pointers on the same page as another key had a lossy pointer. Also, keyGetItem was extremely inefficient for cases where a single index key generates multiple "entry" streams, such as an @@ operator with a multiple-clause tsquery. The presence of a lossy page pointer in any one stream defeated its ability to use the opclass consistentFn, resulting in probing many heap pages that didn't really need to be visited. In Artur's example case, a query like WHERE tsvector @@ to_tsquery('a & b') was about 50X slower than the theoretically equivalent WHERE tsvector @@ to_tsquery('a') AND tsvector @@ to_tsquery('b') The way that I chose to fix this was to have GIN call the consistentFn twice with both TRUE and FALSE values for the in-doubt entry stream, returning a hit if either call produces TRUE, but not if they both return FALSE. The code handles this for the case of a single in-doubt entry stream, but punts (falling back to the stupid behavior) if there's more than one lossy reference to the same page. The idea could be scaled up to deal with multiple lossy references, but I think that would probably be wasted complexity. At least to judge by Artur's example, such cases don't occur often enough to be worth trying to optimize. Back-patch to 8.4. 8.3 did not have lossy GIN index pointers, so not subject to these problems.
* Make details of the Numeric representation private to numeric.c.Robert Haas2010-07-30
| | | | Review by Tom Lane.
* Improved version of patch to protect pg_get_expr() against misuse:Tom Lane2010-07-29
| | | | | | | | | | | look through join alias Vars to avoid breaking join queries, and move the test to someplace where it will catch more possible ways of calling a function. We still ought to throw away the whole thing in favor of a data-type-based solution, but that's not feasible in the back branches. This needs to be back-patched further than 9.0, but I don't have time to do so today. Committing now so that the fix gets into 9.0beta4.
* Rename asyncCommitLSN to asyncXactLSN to reflect changed role in 9.0.Simon Riggs2010-07-29
| | | | | | Transaction aborts now record their LSN to avoid corner case behaviour in SR/HS, hence change of name of variables and functions. As pointed out by Fujii Masao. Cosmetic changes only.
* Clean up some inconsistencies in the volatility marking of various I/OTom Lane2010-07-29
| | | | | | | | | | | | | | | | | | | | related functions. Per today's discussion, we will henceforth assume that datatype I/O functions are either stable or immutable, never volatile. (This implies in particular that domain CHECK constraint expressions shouldn't be volatile, since domain_in executes them.) In turn, functions that execute the I/O functions of arbitrary datatypes should always be labeled stable. This affects the labeling of array_to_string, which was unsafely marked immutable, and record_in, record_out, record_recv, record_send, domain_in, domain_recv, which were over-conservatively marked volatile. The array I/O functions were already marked stable, which is correct per this policy but would have been wrong if we maintained domain_in as volatile. Back-patch to 9.0, along with an earlier fix to correctly mark cash_in and cash_out as stable not immutable (since they depend on lc_monetary). No catversion bump --- the implications of this are not currently severe enough to justify a forced initdb.
* Fix another longstanding problem in copy_relation_data: it was blithelyTom Lane2010-07-29
| | | | | | | | | | | assuming that a local char[] array would be aligned on at least a word boundary. There are architectures on which that is pretty much guaranteed to NOT be the case ... and those arches also don't like non-aligned memory accesses, meaning that log_newpage() would crash if it ever got invoked. Even on Intel-ish machines there's a potential for a large performance penalty from doing I/O to an inadequately aligned buffer. So palloc it instead. Backpatch to 8.0 --- 7.4 doesn't have this code.
* Fix possible page corruption by ALTER TABLE .. SET TABLESPACE.Robert Haas2010-07-29
| | | | | | | | | | | | | | If a zeroed page is present in the heap, ALTER TABLE .. SET TABLESPACE will set the LSN and TLI while copying it, which is wrong, and heap_xlog_newpage() will do the same thing during replay, so the corruption propagates to any standby. Note, however, that the bug can't be demonstrated unless archiving is enabled, since in that case we skip WAL logging altogether, and the LSN/TLI are not set. Back-patch to 8.0; prior releases do not have tablespaces. Analysis and patch by Jeff Davis. Adjustments for back-branches and minor wordsmithing by me.
* Add explicit regression tests for ALTER TABLE lock levels.Simon Riggs2010-07-29
| | | | | Use this to catch a couple of lock level assignments that slipped through manual testing, per Peter Eisentraut.
* Fix oversight in new EvalPlanQual logic: the second loop over the ExecRowMarkTom Lane2010-07-28
| | | | | | list in ExecLockRows() forgot to allow for the possibility that some of the rowmarks are for child tables that aren't relevant to the current row. Per report from Kenichiro Tanaka.
* Reduce lock levels of CREATE TRIGGER and some ALTER TABLE, CREATE RULE actions.Simon Riggs2010-07-28
| | | | | | | | | Avoid hard-coding lockmode used for many altering DDL commands, allowing easier future changes of lock levels. Implementation of initial analysis on DDL sub-commands, so that many lock levels are now at ShareUpdateExclusiveLock or ShareRowExclusiveLock, allowing certain DDL not to block reads/writes. First of number of planned changes in this area; additional docs required when full project complete.
* Fix potential failure when hashing the output of a subplan that producesTom Lane2010-07-28
| | | | | | | | | | | | | | | a pass-by-reference datatype with a nontrivial projection step. We were using the same memory context for the projection operation as for the temporary context used by the hashtable routines in execGrouping.c. However, the hashtable routines feel free to reset their temp context at any time, which'd lead to destroying input data that was still needed. Report and diagnosis by Tao Ma. Back-patch to 8.1, where the problem was introduced by the changes that allowed us to work with "virtual" tuples instead of materializing intermediate tuple values everywhere. The earlier code looks quite similar, but it doesn't suffer the problem because the data gets copied into another context as a result of having to materialize ExecProject's output tuple.
* Show psql timing output even in quiet modePeter Eisentraut2010-07-28
| | | | These two settings ought to be independent of each other.
* In postgresql.conf.sample, use on/off rather than true/false.Robert Haas2010-07-27
| | | | | | | We used to be consistent about this, but my recent patch to add a restart_after_crash GUC failed to follow the existing convention. Report and patch from Fujii Masao.
* Ensure $_SHARED is declared in the main:: namespace, per bugs #5570 and #5571.Alvaro Herrera2010-07-27
| | | | Author: Alex Hunsaker
* CREATE TABLE IF NOT EXISTS.Robert Haas2010-07-25
| | | | Reviewed by Bernd Helmle.
* Add more checks against altering typed tablesPeter Eisentraut2010-07-23
| | | | | | | | - Prohibit altering column type - Prohibit changing inheritance - Move checks from Exec to Prep phases in ALTER TABLE code backpatched to 9.0
* Have psql avoid describing local sockets as host names.Robert Haas2010-07-23
| | | | | | | We now use the phrase 'via local socket in' rather than 'on host' in both \c and \conninfo output, when applicable. Fujii Masao, with some kibitzing by me.
* Avoid deep recursion when assigning XIDs to multiple levels of subxacts.Robert Haas2010-07-23
| | | | | | Backpatch to 8.0. Andres Freund, with cleanup and adjustment for older branches by me.
* Add missing function prototype.Robert Haas2010-07-22
| | | | Fujii Masao
* Fix bogus server version in pg_dumpall --quote-all-identifiers.Robert Haas2010-07-22
|
* Add options to force quoting of all identifiers.Robert Haas2010-07-22
| | | | | | | | | | I've added a quote_all_identifiers GUC which affects the behavior of the backend, and a --quote-all-identifiers argument to pg_dump and pg_dumpall which sets the GUC and also affects the quoting done internally by those applications. Design by Tom Lane; review by Alex Hunsaker; in response to bug #5488 filed by Hartmut Goebel.
* Centralize DML permissions-checking logic.Robert Haas2010-07-22
| | | | | | | | | | | | Remove bespoke code in DoCopy and RI_Initial_Check, which now instead fabricate call ExecCheckRTPerms with a manufactured RangeTblEntry. This is intended to make it feasible for an enhanced security provider to actually make use of ExecutorCheckPerms_hook, but also has the advantage that RI_Initial_Check can allow use of the fast-path when column-level but not table-level permissions are present. KaiGai Kohei. Reviewed (in an earlier version) by Stephen Frost, and by me. Some further changes to the comments by me.
* CVS test: please ignoreBruce Momjian2010-07-20
| | | | Does modification just of CVS tag text cause an empty CVS diff for the commit?
* Properly replay CREATE TABLESPACE during crash recovery by deletingBruce Momjian2010-07-20
| | | | | | | | directory/symlink before creation. Report from Tom Lane. Backpatch to 9.0.
* Have \conninfo mention the port even for local sockets.Robert Haas2010-07-20
| | | | | | | | Per discussion with David Christensen, there can be multiple instances of PG accessible via local sockets, and you need the port to see which one you're actually connected to. David's original patch worked this way, but I inadvertently ripped it out during commit.
* Add \conninfo command to psql, to show current connection info.Robert Haas2010-07-20
| | | | David Christensen. Reviewed by Steve Singer. Some further changes by me.
* Make ECPG regression tests independent of standard_conforming_strings.Robert Haas2010-07-20
| | | | Per buildfarm, again.
* Add restart_after_crash GUC.Robert Haas2010-07-20
| | | | | | | | | | | Normally, we automatically restart after a backend crash, but in some cases when PostgreSQL is invoked by clusterware it may be desirable to suppress this behavior, so we provide an option which does this. Since no existing GUC group quite fits, create a new group called "error handling options" for this and the previously undocumented GUC exit_on_error, which is now documented. Review by Fujii Masao.
* Change the default value of standard_conforming_strings to on.Robert Haas2010-07-20
| | | | | This change should be publicized to driver maintainers at once and release-noted as an incompatibility with previous releases.
* Portability fixes for Solaris for requirepeer feature patchPeter Eisentraut2010-07-19
| | | | per report from Dave Page
* Remove unnecessary "Not safe to send CSV data" complaint from elog.c's fallbackTom Lane2010-07-18
| | | | | | | | | path when CSV logging is configured but not yet operational. It's sufficient to send the message to stderr, as we were already doing, and the "Not safe" gripe has already confused at least two core members ... Backpatch to 9.0, but not further --- doesn't seem appropriate to change this behavior in stable branches.
* Allow ORDER BY/GROUP BY/etc items to match targetlist items regardless ofTom Lane2010-07-18
| | | | | | | | | | | | | | | | | any implicit casting previously applied to the targetlist item. This is reasonable because the implicit cast, by definition, wasn't written by the user; so we are preserving the expected behavior that ORDER BY items match textually equivalent tlist items. The case never arose before because there couldn't be any implicit casting of a top-level SELECT item before we process ORDER BY etc. But now it can arise in the context of aggregates containing ORDER BY clauses, since the "targetlist" is the already-casted list of arguments for the aggregate. The net effect is that the datatype used for ORDER BY/DISTINCT purposes is the aggregate's declared input type, not that of the original input column; which is a bit debatable but not horrendous, and to do otherwise would require major rework that doesn't seem justified. Per bug #5564 from Daniel Grace. Back-patch to 9.0 where aggregate ORDER BY was implemented.
* Fix up poor handling of unsupported-platform case in requirepeer patch.Tom Lane2010-07-18
|
* Fix thinko in recent patch: 'sock' should be 'conn->sock'.Tom Lane2010-07-18
|
* Add SO_PEERCRED check in new unix domain socket permission checking code.Bruce Momjian2010-07-18
|
* Add server authentication over Unix-domain socketsPeter Eisentraut2010-07-18
| | | | | | | This adds a libpq connection parameter requirepeer that specifies the user name that the server process is expected to run under. reviewed by KaiGai Kohei
* Simplify missing tablespace replay error hint message, but only in HEADBruce Momjian2010-07-18
| | | | so we don't need to re-translate for 9.0.
* Add a log_file_mode GUC that allows control of the file permissions set onTom Lane2010-07-16
| | | | | | | | | log files created by the syslogger process. In passing, make unix_file_permissions display its value in octal, same as log_file_mode now does. Martin Pihlak
* Add support for dividing money by money (yielding a float8 result) and forTom Lane2010-07-16
| | | | | | casting between money and numeric. Andy Balholm, reviewed by Kevin Grittner
* Remove a sanity check in the exclusion-constraint code that prevented usersTom Lane2010-07-16
| | | | | | | | | | | from defining non-self-conflicting constraints. Jeff Davis Note: I (tgl) objected to removing this check in 9.0 on the grounds that it was an important sanity check in new, poorly tested code. However, it should be all right to remove it for 9.1, since we'll get field testing from the 9.0 branch.
* Remove duplicate code in DefineOpFamily().Tom Lane2010-07-16
| | | | | | | The code was probably meant to be this way all along, since the subroutine CreateOpFamily previously had only one caller. But it wasn't. KaiGai Kohei
* Fix several problems in pg_dump's handling of SQL/MED objects, notably failureTom Lane2010-07-14
| | | | | | | | | to dump a PUBLIC user mapping correctly, as per bug #5560 from Shigeru Hanada. Use the pg_user_mappings view rather than trying to access pg_user_mapping directly, so that the code doesn't fail when run by a non-superuser. And clean up some minor carelessness such as unsafe usage of fmtId(). Back-patch to 8.4 where this code was added.
* Allow full SSL certificate verification (wherein libpq checks its host nameTom Lane2010-07-14
| | | | | | | | | | | | | | | parameter against server cert's CN field) to succeed in the case where both host and hostaddr are specified. As with the existing precedents for Kerberos, GSSAPI, SSPI, it is the calling application's responsibility that host and hostaddr match up --- we just use the host name as given. Per bug #5559 from Christopher Head. In passing, make the error handling and messages for the no-host-name-given failure more consistent among these four cases, and correct a lie in the documentation: we don't attempt to reverse-lookup host from hostaddr if host is missing. Back-patch to 8.4 where SSL cert verification was introduced.
* Teach EXPLAIN to print PARAM_EXEC Params as the referenced expressions,Tom Lane2010-07-13
| | | | | | | | | | | | | | | | rather than just $N. This brings the display of nestloop-inner-indexscan plans back to where it's been, and incidentally improves the display of SubPlan parameters as well. In passing, simplify the EXPLAIN code by having it deal primarily in the PlanState tree rather than separately searching Plan and PlanState trees. This is noticeably cleaner for subplans, and about a wash elsewhere. One small difference from previous behavior is that EXPLAIN will no longer qualify local variable references in inner-indexscan plan nodes, since it no longer sees such nodes as possibly referencing multiple tables. Vars referenced through PARAM_EXEC Params are still forcibly qualified, though, so I don't think the display is any more confusing than before. Adjust a couple of examples in the documentation to match this behavior.
* Print each test_fsync description while test is running, rather than atBruce Momjian2010-07-13
| | | | the end.
* Oops, in the previous fix to prevent a cursor that's being used in a FORHeikki Linnakangas2010-07-13
| | | | | | | | | loop from being dropped, I missed subtransaction cleanup. Pinned portals must be dropped at subtransaction cleanup just as they are at main transaction cleanup. Per bug #5556 by Robert Walker. Backpatch to 8.0, 7.4 didn't have subtransactions.
* Make NestLoop plan nodes pass outer-relation variables into their innerTom Lane2010-07-12
| | | | | | | | | | | | relation using the general PARAM_EXEC executor parameter mechanism, rather than the ad-hoc kluge of passing the outer tuple down through ExecReScan. The previous method was hard to understand and could never be extended to handle parameters coming from multiple join levels. This patch doesn't change the set of possible plans nor have any significant performance effect, but it's necessary infrastructure for future generalization of the concept of an inner indexscan plan. ExecReScan's second parameter is now unused, so it's removed.
* Document bump of minor library version numbers.Bruce Momjian2010-07-12
|