summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2008-03-23Avoid a useless tuple copy within nodeMaterial. Neil ConwayTom Lane
2008-03-23Create a function quote_nullable(), which works the same as quote_literal()Tom Lane
except that it returns the string 'NULL', rather than a SQL null, when called with a null argument. This is often a much more useful behavior for constructing dynamic queries. Add more discussion to the documentation about how to use these functions. Brendan Jurd
2008-03-22Refactor to_char/to_date formatting code; primarily, replace DCH_processorTom Lane
with two new functions DCH_to_char and DCH_from_char that have less confusing APIs. Brendan Jurd
2008-03-22Add server side lo_import(filename, oid) function.Tatsuo Ishii
2008-03-21Remove TypeName struct's timezone flag, which has been write-only storageTom Lane
for a very long time --- in current usage it's entirely redundant with the name field.
2008-03-21Give an explicit error for serial[], rather than silently ignoringTom Lane
the array decoration as the code had been doing.
2008-03-21Report the current queries of all backends involved in a deadlockTom Lane
(if they'd be visible to the current user in pg_stat_activity). This might look like it's subject to race conditions, but it's actually pretty safe because at the time DeadLockReport() is constructing the report, we haven't yet aborted our transaction and so we can expect that everyone else involved in the deadlock is still blocked on some lock. (There are corner cases where that might not be true, such as a statement timeout triggering in another backend before we finish reporting; but at worst we'd report a misleading activity string, so it seems acceptable considering the usefulness of reporting the queries.) Original patch by Itagaki Takahiro, heavily modified by me.
2008-03-21Corrected version number.Michael Meskes
2008-03-21More README src cleanups.Bruce Momjian
2008-03-21Generate dummy probes.h for MSVC builds.Andrew Dunstan
2008-03-21Get rid of a bunch of #ifdef HAVE_INT64_TIMESTAMP conditionals by inventingTom Lane
a new typedef TimeOffset to represent an intermediate time value. It's either int64 or double as appropriate, and in most usages will be measured in microseconds or seconds the same as Timestamp. We don't call it Timestamp, though, since the value doesn't necessarily represent an absolute time instant. Warren Turkal
2008-03-20Arrange for an explicit cast applied to an ARRAY[] constructor to be appliedTom Lane
directly to all the member expressions, instead of the previous implementation where the ARRAY[] constructor would infer a common element type and then we'd coerce the finished array after the fact. This has a number of benefits, one being that we can allow an empty ARRAY[] construct so long as its element type is specified by such a cast. Brendan Jurd, minor fixes by me.
2008-03-20Add a couple of missing FreeQueryDesc calls. Noticed while testing aAlvaro Herrera
framework to keep track of snapshots in use.
2008-03-20Make source code READMEs more consistent. Add CVS tags to all README files.Bruce Momjian
2008-03-20Dept of second thoughts: --no-tablespaces had better also preventTom Lane
pg_dumpall from attaching TABLESPACE options to CREATE DATABASE commands.
2008-03-20Support a --no-tablespaces option in pg_dump/pg_dumpall/pg_restore, so thatTom Lane
dumps can be loaded into databases without the same tablespaces that the source had. The option acts by suppressing all "SET default_tablespace" commands, and also CREATE TABLESPACE commands in pg_dumpall's case. Gavin Roy, with documentation and minor fixes by me.
2008-03-20Added ECPGget_PGconn() function to ecpglib, courtesy of Mike Aubury.Michael Meskes
Removed one include file from connect-test1.
2008-03-20Changed statement escaping to not escape continuation line markers.Michael Meskes
2008-03-20Add the missing cyrillic "Yo" characters ('e' and 'E' with two dots) to theHeikki Linnakangas
ISO_8859-5 <-> MULE_INTERNAL conversion tables. This was discovered when trying to convert a string containing those characters from ISO_8859-5 to Windows-1251, because we use MULE_INTERNAL/KOI8R as an intermediate encoding between those two. While the missing "Yo" was just an omission in the conversion tables, there are a few other characters like the "Numero" sign ("No" as a single character) that exists in all the other cyrillic encodings (win1251, ISO_8859-5 and cp866), but not in KOI8R. Added comments about that. Patch by Sergey Burladyan. Back-patch to 7.4.
2008-03-19Remove another useless snapshot creation.Alvaro Herrera
2008-03-19Support ALTER TYPE RENAME. Petr JelinekTom Lane
2008-03-19We no longer need a snapshot set after opening the finishing transaction: thisAlvaro Herrera
is redundant because autovacuum now always analyzes a single table per transaction.
2008-03-19Fix regexp substring matching (substring(string from pattern)) for the cornerTom Lane
case where there is a match to the pattern overall but the user has specified a parenthesized subexpression and that subexpression hasn't got a match. An example is substring('foo' from 'foo(bar)?'). This should return NULL, since (bar) isn't matched, but it was mistakenly returning the whole-pattern match instead (ie, 'foo'). Per bug #4044 from Rui Martins. This has been broken since the beginning; patch in all supported versions. The old behavior was sufficiently inconsistent that it's impossible to believe anyone is depending on it.
2008-03-19Add libpq new API lo_import_with_oid() which is similar to lo_import()Tatsuo Ishii
except that lob's oid can be specified.
2008-03-18Add find_typedef comments for Linux.Bruce Momjian
2008-03-18Add find_typedef comment.Bruce Momjian
2008-03-18Add Linux support to find_typedefs, with help from Alvaro.Bruce Momjian
2008-03-18Arrange to "inline" SQL functions that appear in a query's FROM clause,Tom Lane
are declared to return set, and consist of just a single SELECT. We can replace the FROM-item with a sub-SELECT and then optimize much as if we were dealing with a view. Patch from Richard Rowell, cleaned up by me.
2008-03-18Don't need -Wno-error anymore, because flex is no longer producing warnings.Peter Eisentraut
2008-03-18Catch all errors in for and while loops in makefiles. Don't ignore anyPeter Eisentraut
errors in any commands, including in various clean targets that have so far been handled inconsistently. make -i is available to ignore all errors in a consistent and official way.
2008-03-18Move elog(DEBUG4) call outside the locked area, per suggestion from Tom Lane.Alvaro Herrera
2008-03-18Advance multiple array keys rightmost-first instead of leftmost-firstTom Lane
during a bitmap index scan. This cannot affect the query results (since we're just dumping the TIDs into a bitmap) but it might offer some advantage in locality of access to the index. Per Greg Stark.
2008-03-18Fix our printf implementation to follow spec: if a star parameterTom Lane
value for a precision is negative, act as though precision weren't specified at all, that is the whole .* part of the format spec should be ignored. Our previous coding took it as .0 which is certainly wrong. Per report from Kris Jurka and local testing. Possibly this should be back-patched, but it would be good to get some more testing first; in any case there are no known cases where there's really a problem on the backend side.
2008-03-17Enable probes to work with Mac OS X Leopard and other OSes that willPeter Eisentraut
support DTrace in the future. Switch from using DTRACE_PROBEn macros to the dynamically generated macros. Use "dtrace -h" to create a header file that contains the dynamically generated macros to be used in the source code instead of the DTRACE_PROBEn macros. A dummy header file is generated for builds without DTrace support. Author: Robert Lor <Robert.Lor@sun.com>
2008-03-17We need to rebuild objfiles.txt when one of the subdirectories' objfiles.txtPeter Eisentraut
changed in case a new file got added.
2008-03-17Fix postgres --describe-config for guc enums, breakage noted by Alvaro.Magnus Hagander
While at it, rename option lookup functions to make names clearer, per discussion with Tom.
2008-03-17Revert thinko introduced into prefix_selectivity() by my recent patch:Tom Lane
make_greater_string needs the < procedure not the >= one. Spotted by Peter.
2008-03-17Move ProcState definition into sinvaladt.c from sinvaladt.h, since it's notAlvaro Herrera
needed anywhere after my previous patch. Noticed by Tom Lane. Also, remove #include <signal.h> from sinval.c.
2008-03-17Grab some low-hanging fruit in the new hash index build code.Tom Lane
oprofile shows that a nontrivial amount of time is being spent in repeated calls to index_getprocinfo, which really only needs to be called once. So do that, and inline _hash_datum2hashkey to make it work.
2008-03-17Fix TransactionIdIsCurrentTransactionId() to use binary search instead ofTom Lane
linear search when checking child-transaction XIDs. This makes for an important speedup in transactions that have large numbers of children, as in a recent example from Craig Ringer. We can also get rid of an ugly kluge that represented lists of TransactionIds as lists of OIDs. Heikki Linnakangas
2008-03-16When creating a large hash index, pre-sort the index entries by estimatedTom Lane
bucket number, so as to ensure locality of access to the index during the insertion step. Without this, building an index significantly larger than available RAM takes a very long time because of thrashing. On the other hand, sorting is just useless overhead when the index does fit in RAM. We choose to sort when the initial index size exceeds effective_cache_size. This is a revised version of work by Tom Raney and Shreya Bhargava.
2008-03-16Modify interactions between sinval.c and sinvaladt.c. The code that actuallyAlvaro Herrera
deals with the queue, including locking etc, is all in sinvaladt.c. This means that the struct definition of the queue, and the queue pointer, are now internal "implementation details" inside sinvaladt.c. Per my proposal dated 25-Jun-2007 and followup discussion.
2008-03-16Some cleanups of enum-guc code, per comments from Tom.Magnus Hagander
2008-03-15Change hash index creation so that rather than always establishing exactlyTom Lane
two buckets at the start, we create a number of buckets appropriate for the estimated size of the table. This avoids a lot of expensive bucket-split actions during initial index build on an already-populated table. This is one of the two core ideas of Tom Raney and Shreya Bhargava's patch to reduce hash index build time. I'm committing it separately to make it easier for people to test the effects of this separately from the effects of their other core idea (pre-sorting the index entries by bucket number).
2008-03-14Fix inappropriately-timed memory context switch in autovacuum_do_vac_analyze.Tom Lane
This accidentally failed to fail before 8.3, because the context we were switching back to was long-lived anyway; but it sure looks risky as can be now. Well spotted by Pavan Deolasee.
2008-03-14Fix vacuum so that autovacuum is really not cancelled when doing an emergencyAlvaro Herrera
job (i.e. to prevent Xid wraparound problems.) Bug reported by ITAGAKI Takahiro in 20080314103837.63D3.52131E4D@oss.ntt.co.jp, though I didn't use his patch.
2008-03-13Update to tzdata 2008a distribution (Chilean DST law change).Tom Lane
2008-03-13Fix varstr_cmp's special case for UTF8 encoding on Windows so that stringsTom Lane
that are reported as "equal" by wcscoll() are checked to see if they really are bitwise equal, and are sorted per strcmp() if not. We made this happen a couple of years ago in the regular code path, but it unaccountably got left out of the Windows/UTF8 case (probably brain fade on my part at the time). As in the prior set of changes, affected users may need to reindex indexes on textual columns. Backpatch as far as 8.2, which is the oldest release we are still supporting on Windows.
2008-03-13Fix heap_page_prune's problem with failing to send cache invalidationTom Lane
messages if the calling transaction aborts later on. Collapsing out line pointer redirects is a done deal as soon as we complete the page update, so syscache *must* be notified even if the VACUUM FULL as a whole doesn't complete. To fix, add some functionality to inval.c to allow the pending inval messages to be sent immediately while heap_page_prune is still running. The implementation is a bit chintzy: it will only work in the context of VACUUM FULL. But that's all we need now, and it can always be extended later if needed. Per my trouble report of a week ago.
2008-03-12Fix pg_plan_queries() to restore the previous setting of ActiveSnapshotTom Lane
(probably NULL) before exiting. Up to now it's just left the variable as it set it, which means that after we're done processing the current client message, ActiveSnapshot is probably pointing at garbage (because this function is typically run in MessageContext which will get reset). There doesn't seem to have been any code path in which that mattered before 8.3, but now the plancache module might try to use the stale value if the next client message is a Bind for a prepared statement that is in need of replanning. Per report from Alex Hunsaker.