summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2009-08-12Allow backends to start up without use of the flat-file copy of pg_database.Tom Lane
To make this work in the base case, pg_database now has a nailed-in-cache relation descriptor that is initialized using hardwired knowledge in relcache.c. This means pg_database is added to the set of relations that need to have a Schema_pg_xxx macro maintained in pg_attribute.h. When this path is taken, we'll have to do a seqscan of pg_database to find the row we need. In the normal case, we are able to do an indexscan to find the database's row by name. This is made possible by storing a global relcache init file that describes only the shared catalogs and their indexes (and therefore is usable by all backends in any database). A new backend loads this cache file, finds its database OID after an indexscan on pg_database, and then loads the local relcache init file for that database. This change should effectively eliminate number of databases as a factor in backend startup time, even with large numbers of databases. However, the real reason for doing it is as a first step towards getting rid of the flat files altogether. There are still several other sub-projects to be tackled before that can happen.
2009-08-12Fix old bug in log_autovacuum_min_duration code: it was relying on being ableTom Lane
to access a Relation entry it had just closed. I happened to be testing with CLOBBER_CACHE_ALWAYS, which made this a guaranteed core dump (at least on machines where sprintf %s isn't forgiving of a NULL pointer). It's probably quite unlikely that it would fail in the field, but a bug is a bug. Fix by moving the relation_close call down past the logging action.
2009-08-12Split the plpython regression test into test cases arranged by topic, insteadPeter Eisentraut
of the previous monolithic setup-create-run sequence, that was apparently inherited from a previous test infrastructure, but makes working with the tests and adding new ones weird.
2009-08-10Refactor NUM_cache_remove calls in error report path to a PG_TRY block.Alvaro Herrera
The code in the new block was not reindented; it will be fixed by pgindent eventually.
2009-08-10Support EEEE (scientific notation) in to_char().Tom Lane
Pavel Stehule, Brendan Jurd
2009-08-10Adjust test_fsync code to be more sane.Bruce Momjian
Backpatch to 8.4.X.
2009-08-10Extend EXPLAIN to support output in XML or JSON format.Tom Lane
There are probably still some adjustments to be made in the details of the output, but this gets the basic structure in place. Robert Haas
2009-08-09Ship documentation without intermediate tarballsPeter Eisentraut
Documentation files in HTML and man formats are now prepared for distribution using the distprep make target, like everything else. They are placed in doc/src/sgml/html and manX and installed from there by make install, if present. The business with the tarballs in the tarball is gone.
2009-08-08Document that LocalSetXLogInsertAllowed can be re-executed.Tom Lane
Per comment from Simon.
2009-08-07Modify parallel pg_restore to track pending and ready items by means ofTom Lane
two new lists, rather than repeatedly rescanning the main TOC list. This avoids a potential O(N^2) slowdown, although you'd need a *lot* of tables to make that really significant; and it might simplify future improvements in the scheduling algorithm by making the set of ready items more easily inspectable. The original thought that it would in itself result in a more efficient job dispatch order doesn't seem to have been borne out in testing, but it seems worth doing anyway.
2009-08-07Expand test coverage support to entire treePeter Eisentraut
Test coverage support now covers the entire source tree, including contrib, instead of just src/backend. In a related but independent development, the commands make coverage and make coverage-html can be run in any directory. This turned out to be much easier than feared. Besides a few ad hoc fixes to pass the make target down the tree, change all affected makefiles to list their directories in the SUBDIRS variable, changed from variants like DIRS and WANTED_DIRS. MSVC build fix was attempted as well.
2009-08-07Try to defend against the possibility that libpq is still in COPY_IN stateTom Lane
when we reach the post-COPY "pump it dry" error recovery code that was added 2006-11-24. Per a report from Neil Best, there is at least one code path in which this occurs, leading to an infinite loop in code that's supposed to be making it more robust not less so. A reasonable response seems to be to call PQputCopyEnd() again, so let's try that. Back-patch to all versions that contain the cleanup loop.
2009-08-07rm_cleanup functions need to be allowed to write WAL entries. This oversightTom Lane
appears to explain the recent reports of "PANIC: cannot make new WAL entries during recovery".
2009-08-07Remove unused ecpg variable.Bruce Momjian
2009-08-07Remove long-since-unused file commands/version.h.Tom Lane
Noticed by Itagaki Takahiro.
2009-08-07Fix some omissions in the dependency-object-class support for SQL/MED objects.Tom Lane
Main problem found by Muhammad Aqeel, some cosmetic additions by me.
2009-08-07Added STRING datatype for Informix compatibility mode. This work isMichael Meskes
based on a patch send in by Böszörményi Zoltán <zb@cybertec.at>.
2009-08-07Fast shutdown stop should forcibly disconnect any active backends, evenHeikki Linnakangas
if a smart shutdown is already in progress. Backpatch to 8.3, this was broken in the patch that introduced "dead-end backends". Per report by Itagaki Takahiro, patch by Fujii Masao.
2009-08-06Improve plpgsql's ability to cope with rowtypes containing dropped columns,Tom Lane
by supporting conversions in places that used to demand exact rowtype match. Since this issue is certain to come up elsewhere (in fact, already has, in ExecEvalConvertRowtype), factor out the support code into new core functions for tuple conversion. I chose to put these in a new source file since heaptuple.c is already overly long. Heavily revised version of a patch by Pavel Stehule.
2009-08-06Avoid terminating the postmaster on a number of "can't happen" cases duringMagnus Hagander
backend startup on Win32. Instead, log the error and just forget about the potentially dangling process, since we can't do anything about it anyway.
2009-08-05Improve error messages in md.c. When a filesystem operation like open() orHeikki Linnakangas
fsync() fails, say "file" rather than "relation" when printing the filename. This makes messages that display block numbers a bit confusing. For example, in message 'could not read block 150000 of file "base/1234/5678.1"', 150000 is the block number from the beginning of the relation, ie. segment 0, not 150000th block within that segment. Per discussion, users aren't usually interested in the exact location within the file, so we can live with that. To ease constructing error messages, add FilePathName(File) function to return the pathname of a virtual fd.
2009-08-05Fixed copyright notice.Michael Meskes
2009-08-04Use DocBook XSL stylesheets for man page buildingPeter Eisentraut
This switches the man page building process to use the DocBook XSL stylesheet toolchain. The previous targets for Docbook2X are removed. configure has been updated to look for the new tools. The Documentation appendix contains the new build instructions. There are also a few isolated tweaks in the documentation to improve places that came out strangely in the man pages.
2009-08-04Fix pg_dump to do the right thing when escaping the contents of large objects.Tom Lane
The previous implementation got it right in most cases but failed in one: if you pg_dump into an archive with standard_conforming_strings enabled, then pg_restore to a script file (not directly to a database), the script will set standard_conforming_strings = on but then emit large object data as nonstandardly-escaped strings. At the moment the code is made to emit hex-format bytea strings when dumping to a script file. We might want to change to old-style escaping for backwards compatibility, but that would be slower and bulkier. If we do, it's just a matter of reimplementing appendByteaLiteral(). This has been broken for a long time, but given the lack of field complaints I'm not going to worry about back-patching.
2009-08-04Avoid including miscadmin.h into plpgsql.h; instead include it into the twoAlvaro Herrera
source files that need it.
2009-08-04Fix an ecpg test, too. Are we there yet?Tom Lane
2009-08-04Suppress pointer-signedness warning.Tom Lane
2009-08-04Teach PQescapeByteaConn() to use hex format when the target connection isTom Lane
to a server >= 8.5. Per my proposal in discussion of hex-format patch.
2009-08-04Support hex-string input and output for type BYTEA.Tom Lane
Both hex format and the traditional "escape" format are automatically handled on input. The output format is selected by the new GUC variable bytea_output. As committed, bytea_output defaults to HEX, which is an *incompatible change*. We will keep it this way for awhile for testing purposes, but should consider whether to switch to the more backwards-compatible default of ESCAPE before 8.5 is released. Peter Eisentraut
2009-08-04Cause pg_proc.probin to be declared as text, not bytea. Everything wasTom Lane
already treating it as text anyway, to the point that I couldn't find anything to change except the datatype markings in catalog/*.h. The only effect that the bytea declaration had was to cause byteaout() to be invoked when pg_dump (or another client program) inspected the column value. Since pg_dump wasn't expecting that, but just treating what it got as text, the net result is that dump and reload would mangle any backslashes or non-ASCII characters in the filename string for a C-language function. That is a very long-standing bug, but given the lack of field complaints it doesn't seem worth trying to find a back-patchable fix. We'll just make this change to fix it going forward. This change will also forestall problems after the planned change to let bytea emit hex output instead of escaped characters.
2009-08-03Implement has_sequence_privilege()Joe Conway
Add family of functions that did not exist earlier, mainly due to historical omission. Original patch by Abhijit Menon-Sen, with review and modifications by Joe Conway. catversion.h bumped.
2009-08-02Add ALTER TABLE ... ALTER COLUMN ... SET STATISTICS DISTINCTTom Lane
Robert Haas
2009-08-01Department of second thoughts: let's show the exact key during unique indexTom Lane
build failures, too. Refactor a bit more since that error message isn't spelled the same.
2009-08-01Improve unique-constraint-violation error messages to include the exactTom Lane
values being complained of. In passing, also remove the arbitrary length limitation in the similar error detail message for foreign key violations. Itagaki Takahiro
2009-07-31Create a multiplexing structure for signals to Postgres child processes.Tom Lane
This patch gets us out from under the Unix limitation of two user-defined signal types. We already had done something similar for signals directed to the postmaster process; this adds multiplexing for signals directed to backends and auxiliary processes (so long as they're connected to shared memory). As proof of concept, replace the former usage of SIGUSR1 and SIGUSR2 for backends with use of the multiplexing mechanism. There are still some hard-wired definitions of SIGUSR1 and SIGUSR2 for other process types, but getting rid of those doesn't seem interesting at the moment. Fujii Masao
2009-07-30Merge the Constraint and FkConstraint node types into a single type.Tom Lane
This was foreseen to be a good idea long ago, but nobody had got round to doing it. The recent patch for deferred unique constraints made transformConstraintAttrs() ugly enough that I decided it was time. This change will also greatly simplify parsing of deferred CHECK constraints, if anyone ever gets around to implementing that. While at it, add a location field to Constraint, and use that to provide an error cursor for some of the constraint-related error messages.
2009-07-29Fix time_part and timetz_part (ie, EXTRACT() for those datatypes) toTom Lane
include a fractional part in the output for MILLISECOND and SECOND cases, rather than truncating the source value. This is what the float-timestamp code has always done, and it was clearly the code author's intent to do the same for integer timestamps, but he forgot about integer division in C. The other datatypes supported by EXTRACT() already do this correctly. Backpatch to 8.4, so that the default (integer) behavior of that branch will match the default (float) behavior of older branches. Arguably we should patch further back, but it's possible that applications are expecting the broken behavior in older branches. 8.4 is new enough that expectations shouldn't be too settled. Per report from Greg Stark.
2009-07-29Support deferrable uniqueness constraints.Tom Lane
The current implementation fires an AFTER ROW trigger for each tuple that looks like it might be non-unique according to the index contents at the time of insertion. This works well as long as there aren't many conflicts, but won't scale to massive unique-key reassignments. Improving that case is a TODO item. Dean Rasheed
2009-07-29Fix a thinko introduced into CountActiveBackends by a recent patch:Tom Lane
we should ignore NULL array entries, not non-NULL ones. This had the effect of disabling commit_delay, and could have caused a crash in the rare race condition the patch was intended to fix. Bug report and diagnosis by Jeff Janes, in bug #4952.
2009-07-28Correct calculations of overlap and contains operations over polygons.Teodor Sigaev
2009-07-28Fix incorrect cleanup of tsquery in ts_rewrite(). Per bug #4933 byTeodor Sigaev
Aaron Marcuse-Kubitza <aaronmk@blackducksoftware.com>
2009-07-28Add system catalog columns pg_constraint.conindid and pg_trigger.tgconstrindid.Tom Lane
conindid is the index supporting a constraint. We can use this not only for unique/primary-key constraints, but also foreign-key constraints, which depend on the unique index that constrains the referenced columns. tgconstrindid is just copied from the constraint's conindid field, or is zero for triggers not associated with constraints. This is mainly intended as infrastructure for upcoming patches, but it has some virtue in itself, since it exposes a relationship that you formerly had to grovel in pg_depend to determine. I simplified one information_schema view accordingly. (There is a pg_dump query that could also use conindid, but I left it alone because it wasn't clear it'd get any faster.)
2009-07-27Fix minor memory leak in Win32 SID handling functions. Not a big issueMagnus Hagander
since it's only called during process startup, thus no backpatch. Found by TAKATSUKA Haruka, patch by Magnus Hagander and Andrew Chernow
2009-07-27Enable the use of multiple CPUs/cores when building on MSVC. This onlyMagnus Hagander
affects the C compiler step - we still only build one target at a time.
2009-07-27Add s_lock support for SuperH architecture.Tom Lane
After a patch originally submitted by Nobuhiro Iwamatsu, but corrected (I think) to match our guidelines for safe use of asm fragments. This should be considered untested ...
2009-07-27Experiment with using EXPLAIN COSTS OFF in regression tests.Tom Lane
This is a simple test to see whether COSTS OFF will help much with getting EXPLAIN output that's sufficiently platform-independent for use in the regression tests. The planner does have some freedom of choice in these examples (plain via bitmap indexscan), so I'm not sure what will happen.
2009-07-26Extend EXPLAIN to allow generic options to be specified.Tom Lane
The original syntax made it difficult to add options without making them into reserved words. This change parenthesizes the options to avoid that problem, and makes provision for an explicit (and perhaps non-Boolean) value for each option. The original syntax is still supported, but only for the two original options ANALYZE and VERBOSE. As a test case, add a COSTS option that can suppress the planner cost estimates. This may be useful for including EXPLAIN output in the regression tests, which are otherwise unable to cope with cross-platform variations in cost estimates. Robert Haas
2009-07-25Code review for FORCE QUOTE * patch: fix error checking to consider FORCETom Lane
QUOTE * as a variety of FORCE QUOTE, and update psql documentation to include the option. (The actual psql code doesn't seem to need any changes.)
2009-07-25Small stylistic improvement in recent FORCE QUOTE * code - use a bool ↵Andrew Dunstan
instead of a magic value.
2009-07-25Allow * as parameter for FORCE QUOTE for COPY CSV. Itagaki Takahiro.Andrew Dunstan