aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Fixed small typo in changelogMichael Meskes2006-06-21
|
* Added fixed from the coverity report send in by Joachim Wieland ↵Michael Meskes2006-06-21
| | | | | | <joe@mcknight.de> Added missing error handling in a few functions in ecpglib
* Remove redundant gettimeofday() calls to the extent practical withoutTom Lane2006-06-20
| | | | | | | | | | | changing semantics too much. statement_timestamp is now set immediately upon receipt of a client command message, and the various places that used to do their own gettimeofday() calls to mark command startup are referenced to that instead. I have also made stats_command_string use that same value for pg_stat_activity.query_start for both the command itself and its eventual replacement by <IDLE> or <idle in transaction>. There was some debate about that, but no argument that seemed convincing enough to justify an extra gettimeofday() call.
* Split definitions for md5.c out of crypt.h and into their own headerTom Lane2006-06-20
| | | | | | | | | libpq/md5.h, so that there's a clear separation between backend-only definitions and shared frontend/backend definitions. (Turns out this is reversing a bad decision from some years ago...) Fix up references to crypt.h as needed. I looked into moving the code into src/port, but the headers in src/include/libpq are sufficiently intertwined that it seems more work than it's worth to do that.
* Do not use already free'ed errmsg, bug found by Joachim WielandMichael Meskes2006-06-19
| | | | <joachim.wieland@credativ.de>
* Take the statistics collector out of the loop for monitoring backends'Tom Lane2006-06-19
| | | | | | | current commands; instead, store current-status information in shared memory. This substantially reduces the overhead of stats_command_string and also ensures that pg_stat_activity is fully up to date at all times. Per my recent proposal.
* Don't try to call posix_fadvise() unless <fcntl.h> supplies a declarationTom Lane2006-06-18
| | | | | | | | for it. Hopefully will fix core dump evidenced by some buildfarm members since fadvise patch went in. The actual definition of the function is not ABI-compatible with compiler's default assumption in the absence of any declaration, so it's clearly unsafe to try to call it without seeing a declaration.
* Fix saveHistory() to not emit bogus complaint during psql exit when usingTom Lane2006-06-18
| | | | | Darwin's libedit; per my proposal last August. Also, suppress cast-away- const warnings.
* Increase timeout in statement_timeout test from 1 second to 2 seconds.Tom Lane2006-06-18
| | | | | | | | | We have once or twice seen failures suggesting that control didn't get to the exception block before the timeout elapsed, which is unlikely but not impossible in a parallel regression test (with a dozen other backends competing for cycles). This change doesn't completely prevent the problem of course, but it should reduce the probability enough that we don't see it anymore. Per buildfarm results.
* Merge postmaster and postgres command into just postgres. postmasterPeter Eisentraut2006-06-18
| | | | | symlink is kept for now for compatibility. To call single-user mode, use postgres --single.
* Fix a couple of obvious problems in DROP IF EXISTS patch.Tom Lane2006-06-16
|
* Code review for SELECT INTO STRICT patch: use saner choices of errorTom Lane2006-06-16
| | | | SQLSTATEs, fix some documentation problems.
* Document issues with non-default tablespaces and pg_dumpall restores.Bruce Momjian2006-06-16
| | | | Backpatch documentation addition to 8.1.X.
* DROP ... IF EXISTS for the following cases:Andrew Dunstan2006-06-16
| | | | language, tablespace, trigger, rule, opclass, function, aggregate. operator, and cast.
* Fix problems with cached tuple descriptors disappearing while still in useTom Lane2006-06-16
| | | | | | | | | | by creating a reference-count mechanism, similar to what we did a long time ago for catcache entries. The back branches have an ugly solution involving lots of extra copies, but this way is more efficient. Reference counting is only applied to tupdescs that are actually in caches --- there seems no need to use it for tupdescs that are generated in the executor, since they'll go away during plan shutdown by virtue of being in the per-query memory context. Neil Conway and Tom Lane
* Test for POSIX_FADV_DONTNEED to use posix_fadvise().Bruce Momjian2006-06-16
|
* Use posix_fadvise() to avoid kernel caching of WAL contents on WAL fileBruce Momjian2006-06-15
| | | | | | close. ITAGAKI Takahiro
* Add STRICT to PL/pgSQL SELECT INTO, so exceptions are thrown if more orBruce Momjian2006-06-15
| | | | | | | | | less than one row is returned by the SELECT, for Oracle PL/SQL compatibility. Improve SELECT INTO documentation. Matt Miller
* Remove the limit on the number of entries allowed in catcaches, andTom Lane2006-06-15
| | | | | | | | | | | | | | | | | | remove the infrastructure needed to enforce the limit, ie, the global LRU list of cache entries. On small-to-middling databases this wins because maintaining the LRU list is a waste of time. On large databases this wins because it's better to keep more cache entries (we assume such users can afford to use some more per-backend memory than was contemplated in the Berkeley-era catcache design). This provides a noticeable improvement in the speed of psql \d on a 10000-table database, though it doesn't make it instantaneous. While at it, use per-catcache settings for the number of hash buckets per catcache, rather than the former one-size-fits-all value. It's a bit silly to be using the same number of hash buckets for, eg, pg_am and pg_attribute. The specific values I used might need some tuning, but they seem to be in the right ballpark based on CATCACHE_STATS results from the standard regression tests.
* Further thoughts about lo_export/lo_import error handling: if one ofTom Lane2006-06-14
| | | | | | | the lower-level large object functions fails, it will have already set a suitable error message --- probably something from the backend --- and it is not useful to overwrite that with a generic 'error while reading large object' message. So remove redundant messages.
* Clean up psql's control-C handling to avoid longjmp'ing out of randomTom Lane2006-06-14
| | | | | | | | | places --- that risks corrupting data structures, losing sync with the backend, etc. We now longjmp only from calls to readline, fgets, and fread, which we assume are coded to protect themselves against interrupts at undesirable times. This requires adding explicit tests for cancel_pressed in long-running loops, but on the whole it's far cleaner. Martijn van Oosterhout and Tom Lane.
* Improve error detection and recovery in lo_import()/lo_export().Tom Lane2006-06-14
| | | | Problems noted while experimenting with new control-C code for psql.
* Do a CHECK_FOR_INTERRUPTS immediately before terminating a fastpathTom Lane2006-06-14
| | | | | | | | | function call. Previously, there may have been no CHECK_FOR_INTERRUPTS at all in the fastpath code path, making it impossible to cancel an operation such as \lo_import externally. This addition doesn't ensure you can cancel, since your SIGINT may arrive while the backend is idle waiting for the client, but it gives the largest window we can easily provide. Noted while experimenting with new control-C code for psql.
* Add BY clause to PL/PgSQL FOR loop, to control the iteration increment.Bruce Momjian2006-06-12
| | | | Jaime Casanova
* Avoid use of C commment inside C comment from recent Win32 int overflow patch.Bruce Momjian2006-06-12
|
* Prevent Win32 from displaying a popup box on backend crash. Instead letBruce Momjian2006-06-12
| | | | | | the postmaster deal with it. Magnus Hagander
* Win32 can't catch the exception thrown by INT_MIN / -1 or INT_MIN * -1,Bruce Momjian2006-06-12
| | | | | | | so on that platform we test for those before the computation and throw an "out of range" error. Backpatch to 8.1.X.
* Minor code cleanup: make the WIN32 case less gratuitously different fromTom Lane2006-06-12
| | | | the other platform-specific cases in ps_status.
* Code review for psql multiline history patch(es). Fix memory leak,Tom Lane2006-06-11
| | | | | failure to enter commands in history if canceled by control-C, other infelicities.
* Fix Assert failure when a fastpath function call is attempted inside anTom Lane2006-06-11
| | | | | | | | | | | | | | | already-aborted transaction block. GetSnapshotData throws an Assert if not in a valid transaction; hence we mustn't attempt to set a snapshot for the function until after checking for aborted transaction. This is harmless AFAICT if Asserts aren't enabled (GetSnapshotData will compute a bogus snapshot, but it doesn't matter since HandleFunctionRequest will throw an error shortly anywy). Hence, not a major bug. Along the way, add some ability to log fastpath calls when statement logging is turned on. This could probably stand to be improved further, but not logging anything is clearly undesirable. Backpatched as far as 8.0; bug doesn't exist before that.
* Repair remarkably-inefficient query for dumping large object comments: itTom Lane2006-06-09
| | | | | | was invoking obj_description() for each large object chunk, instead of once per large object. This code is new as of 8.1, which may explain why the problem hadn't been noticed already.
* Revert sampling patch for EXPLAIN ANALYZE; it turns out to be too unreliableTom Lane2006-06-09
| | | | | because node timing is much less predictable than the patch expects. I kept the API change for InstrStopNode, however.
* Fix bootstrap.c so that database startup process and bgwriter properly releaseTom Lane2006-06-08
| | | | | | | | | | | | LWLocks during a panic exit. This avoids the possible self-deadlock pointed out by Qingqing Zhou. Also, I noted that an error during LoadFreeSpaceMap() or BuildFlatFiles() would result in exit(0) which would leave the postmaster thinking all is well. Added a critical section to ensure such errors don't allow startup to proceed. Backpatched to 8.1. The 8.0 code is a bit different and I'm not sure if the problem exists there; given we've not seen this reported from the field, I'm going to be conservative about backpatching any further.
* Remove Win32 file, moved to /port.Bruce Momjian2006-06-08
| | | | Magnus Hagander
* Remove obsolete comment about VACUUM FULL: it takes buffer content locksTom Lane2006-06-08
| | | | | now, and must do so to ensure bgwriter doesn't write a page that is in process of being compacted.
* Allow timezone names in SQL strings,Bruce Momjian2006-06-07
| | | | | | '2006-05-24 21:11 Americas/New_York'::timestamptz Joachim Wieland
* Prepare code to be built by MSVC:Bruce Momjian2006-06-07
| | | | | | | | | | o remove many WIN32_CLIENT_ONLY defines o add WIN32_ONLY_COMPILER define o add 3rd argument to open() for portability o add include/port/win32_msvc directory for system includes Magnus Hagander
* Per previous analysis, the most correct notion of SampleOverhead is thatTom Lane2006-06-07
| | | | | | | it is just the total time to do INSTR_TIME_SET_CURRENT(), and not any of the other code involved in InstrStartNode/InstrStopNode. Even though I fear we may end up reverting this patch altogether, we may as well have the most correct version in our CVS archive.
* Have REINDEX use NOTICE, so it can be suppressed.Bruce Momjian2006-06-07
|
* Remove "fuzzy comparison" logic in qsort comparison function forTom Lane2006-06-07
| | | | | | | | | | | | choose_bitmap_and(). It was way too fuzzy --- per comment, it was meant to be 1% relative difference, but was actually coded as 0.01 absolute difference, thus causing selectivities of say 0.001 and 0.000000000001 to be treated as equal. I believe this thinko explains Maxim Boguk's recent complaint. While we could change it to a relative test coded like compare_fuzzy_path_costs(), there's a bigger problem here, which is that any fuzziness at all renders the comparison function non-transitive, which could confuse qsort() to the point of delivering completely wrong results. So forget the whole thing and just do an exact comparison.
* For psql multi-line history, save backslash commands right away, ratherBruce Momjian2006-06-07
| | | | than only if there is already history.
* Use INFO-level for reindex messages, rather than NOTICE.Bruce Momjian2006-06-07
| | | | Euler Taveira de Oliveira
* Update comment.Bruce Momjian2006-06-06
|
* On Win32, return original patch if GetShortPathName() fails (no shortBruce Momjian2006-06-06
| | | | | | name, path does not exist), rather than returning nothing. Backpatch to 8.1.X.
* Make the planner estimate costs for nestloop inner indexscans on the basisTom Lane2006-06-06
| | | | | | | | | | | | | | | | | | | | | that the Mackert-Lohmann formula applies across all the repetitions of the nestloop, not just each scan independently. We use the M-L formula to estimate the number of pages fetched from the index as well as from the table; that isn't what it was designed for, but it seems reasonably applicable anyway. This makes large numbers of repetitions look much cheaper than before, which accords with many reports we've received of overestimation of the cost of a nestloop. Also, change the index access cost model to charge random_page_cost per index leaf page touched, while explicitly not counting anything for access to metapage or upper tree pages. This may all need tweaking after we get some field experience, but in simple tests it seems to be giving saner results than before. The main thing is to get the infrastructure in place to let cost_index() and amcostestimate functions take repeated scans into account at all. Per my recent proposal. Note: this patch changes pg_proc.h, but I did not force initdb because the changes are basically cosmetic --- the system does not look into pg_proc to decide how to call an index amcostestimate function, and there's no way to call such a function from SQL at all.
* Remove ancient AIX structure workaround.Bruce Momjian2006-06-06
|
* Have BCC echo output "" using "", rather than \"\" as earlier reported.Bruce Momjian2006-06-06
| | | | Backpatch to 8.1.X.
* Fixed two more memory leaks in ecpglib.Michael Meskes2006-06-06
| | | | Synced parser.
* Remove extremely old, incomplete, broken example code.Tom Lane2006-06-05
| | | | Per my proposal a few days ago.
* While making the seq_page_cost changes, I was struck by the fact thatTom Lane2006-06-05
| | | | | | | | | | | | | cost_nonsequential_access() is really totally inappropriate for its only remaining use, namely estimating I/O costs in cost_sort(). The routine was designed on the assumption that disk caching might eliminate the need for some re-reads on a random basis, but there's nothing very random in that sense about sort's access pattern --- it'll always be picking up the oldest outputs. If we had a good fix on the effective cache size we might consider charging zero for I/O unless the sort temp file size exceeds it, but that's probably putting much too much faith in the parameter. Instead just drop the logic in favor of a fixed compromise between seq_page_cost and random_page_cost per page of sort I/O.