summaryrefslogtreecommitdiff
path: root/src/backend/commands
AgeCommit message (Collapse)Author
2004-02-12Check only live tuples for OID validity, to avoid issues after ALTERTom Lane
TABLE. Per recent discussion.
2004-02-10Centralize implementation of delay code by creating a pg_usleep()Tom Lane
subroutine in src/port/pgsleep.c. Remove platform dependencies from miscadmin.h and put them in port.h where they belong. Extend recent vacuum cost-based-delay patch to apply to VACUUM FULL, ANALYZE, and non-btree index vacuuming. By the way, where is the documentation for the cost-based-delay patch?
2004-02-10Restructure smgr API as per recent proposal. smgr no longer depends onTom Lane
the relcache, and so the notion of 'blind write' is gone. This should improve efficiency in bgwriter and background checkpoint processes. Internal restructuring in md.c to remove the not-very-useful array of MdfdVec objects --- might as well just use pointers. Also remove the long-dead 'persistent main memory' storage manager (mm.c), since it seems quite unlikely to ever get resurrected.
2004-02-08Win32 signals cleanup. Patch by Magnus Hagander, with input from ClaudioNeil Conway
Natoli and Bruce Momjian (and some cosmetic fixes from Neil Conway). Changes: - remove duplicate signal definitions from pqsignal.h - replace pqkill() with kill() and redefine kill() in Win32 - use ereport() in place of fprintf() in some error handling in pqsignal.c - export pg_queue_signal() and make use of it where necessary - add a console control handler for Ctrl-C and similar handling on Win32 - do WaitForSingleObjectEx() in CHECK_FOR_INTERRUPTS() on Win32; query cancelling should now work on Win32 - various other fixes and cleanups
2004-02-06Cost based vacuum delay feature.Jan Wieck
Jan
2004-02-03Rename SortMem and VacuumMem to work_mem and maintenance_work_mem.Tom Lane
Make btree index creation and initial validation of foreign-key constraints use maintenance_work_mem rather than work_mem as their memory limit. Add some code to guc.c to allow these variables to be referenced by their old names in SHOW and SET commands, for backwards compatibility.
2004-02-02> src/backend/commands/user.c file has some parse error at repalloc(),Bruce Momjian
palloc()$ Fixed. Thanks. > src/backend/postmaster/pgstat.c miss > #include "tcop/tcopprot.h" line. Fixed. > src/utils/dllinit.c wrong include header line at MinGW. > #include <cygwin/version.h> must be not included Fixed. > by the way, > I can't compile eccp because I used lower version bison. > and bin/pg_resetxlog too. in this case I can't find what's wrong. Fixed.
2004-02-02Adjustments for Win32-specific rename code, and add include file.Bruce Momjian
2004-02-02Adjust rename on Win32 to only link to temp name while holding lock,Bruce Momjian
then release locks and loop over renaming to active file name.
2004-01-31Micro-opt: replace calls likeNeil Conway
appendStringInfo(buf, "%s", str); with appendStringInfoString(buf, str); as the latter form is slightly faster.
2004-01-28Review uses of IsUnderPostmaster, change some tests to look atTom Lane
whereToSendOutput instead because they are really inquiring about the correct client communication protocol. Update some comments. This is pointing towards supporting regular FE/BE client protocol in a standalone backend, per discussion a month or so back.
2004-01-27Here's the latest win32 signals code, this time in the form of a patchBruce Momjian
against the latest shapshot. It also includes the replacement of kill() with pqkill() and sigsetmask() with pqsigsetmask(). Passes all tests fine on my linux machine once applied. Still doesn't link completely on Win32 - there are a few things still required. But much closer than before. At Bruce's request, I'm goint to write up a README file about the method of signals delivery chosen and why the others were rejected (basically a summary of the mailinglist discussions). I'll finish that up once/if the patch is accepted. Magnus Hagander
2004-01-26Ensure that close() and fclose() are checked for errors, at least inTom Lane
cases involving writes. Per recent discussion about the possibility of close-time failures on some filesystems. There is a TODO item for this, too.
2004-01-23Fix a minor bug introduced by the recent CREATE TABLE AS / WITH OIDSNeil Conway
patch: a 3-value enum was mistakenly assigned directly to a 'bool' in transformCreateStmt(). Along the way, change makeObjectName() to be static, as it isn't used outside analyze.c
2004-01-19Repair problem identified by Olivier Prenant: ALTER DATABASE SET search_pathTom Lane
should not be too eager to reject paths involving unknown schemas, since it can't really tell whether the schemas exist in the target database. (Also, when reading pg_dumpall output, it could be that the schemas don't exist yet, but eventually will.) ALTER USER SET has a similar issue. So, reduce the normal ERROR to a NOTICE when checking search_path values for these commands. Supporting this requires changing the API for GUC assign_hook functions, which causes the patch to touch a lot of places, but the changes are conceptually trivial.
2004-01-18Don't use %s-with-precision format spec to truncate data being displayedTom Lane
in a COPY error message. It seems that glibc gets indigestion if it is asked to truncate strings that contain invalid UTF-8 encoding sequences. vsnprintf will return -1 in such cases, leading to looping and eventual memory overflow in elog.c. Instead use our own, more robust pg_mbcliplen routine. I believe this problem accounts for several recent reports of unexpected 'out of memory' errors during COPY IN.
2004-01-14Fix permission-checking bug reported by Tim Burgess 10-Feb-03 (this timeTom Lane
for sure...). Rather than relying on the query context of a rangetable entry to identify what permissions it wants checked, store a full AclMode mask in each RTE, and check exactly those bits. This allows an RTE specifying, say, INSERT privilege on a view to be copied into a derived UPDATE query without changing meaning. Per recent discussion thread. initdb forced due to change of stored rule representation.
2004-01-10Implement "WITH / WITHOID OIDS" clause for CREATE TABLE AS. This isNeil Conway
intended to allow application authors to insulate themselves from changes to the default value of 'default_with_oids' in future releases of PostgreSQL. This patch also fixes a bug in the earlier implementation of the 'default_with_oids' GUC variable: code in gram.y should not examine the value of GUC variables directly due to synchronization issues.
2004-01-07More janitorial work: remove the explicit casting of NULL literals to aNeil Conway
pointer type when it is not necessary to do so. For future reference, casting NULL to a pointer type is only necessary when (a) invoking a function AND either (b) the function has no prototype OR (c) the function is a varargs function.
2004-01-06Apply the core parts of Dennis Bjorklund's patch to allow functionTom Lane
parameters to be declared with names. pg_proc has a column to store names, and CREATE FUNCTION can insert data into it, but that's all as yet. I need to do more work on the pg_dump and plpgsql portions of the patch before committing those, but I thought I'd get the bulky changes in before the tree drifts under me. initdb forced due to pg_proc change.
2004-01-06Code cleanup, mostly in the smgr:Neil Conway
- Update comment in IsReservedName() to the present day - Improve some variable & function names in commands/vacuum.c. I was planning to rewrite this to avoid lappend(), but since I still intend to do the list rewrite, there's no need for that. - Update some smgr comments which seemed to imply that we still forced all dirty pages to disk at commit-time. - Replace some #ifdef DIAGNOSTIC code with assertions. - Make the distinction between OS-level file descriptors and virtual file descriptors a little clearer in a few comments - Other minor comment improvements in the smgr code
2003-12-28Clean up the usage of canonicalize_qual(): in particular, be consistentTom Lane
about whether it is applied before or after eval_const_expressions(). I believe there were some corner cases where the system would fail to recognize that a partial index is applicable because of the previous inconsistency. Store normal rather than 'implicit AND' representations of constraints and index predicates in the catalogs. initdb forced due to representation change of constraints/predicates.
2003-12-21Back out:Bruce Momjian
> Attached is a patch that addressed all the discussed issues > that did not break backward compatability, including the > ability to output ISO-8601 compliant intervals by setting > datestyle to iso8601basic.
2003-12-20In my mind there were two categories of open issuesBruce Momjian
a) ones that are 100% backward (such as the comment about outputting this format) and b) ones that aren't (such as deprecating the current postgresql shorthand of '1Y1M'::interval = 1 year 1 minute in favor of the ISO-8601 'P1Y1M'::interval = 1 year 1 month. Attached is a patch that addressed all the discussed issues that did not break backward compatability, including the ability to output ISO-8601 compliant intervals by setting datestyle to iso8601basic. Interval values can now be written as ISO 8601 time intervals, using the "Format with time-unit designators". This format always starts with the character 'P', followed by a string of values followed by single character time-unit designators. A 'T' separates the date and time parts of the interval. Ron Mayer
2003-12-15Add mention with might need to use cp -R someday for portability.Bruce Momjian
2003-12-14I posted some bufmgr cleanup a few weeks ago, but it conflicted withNeil Conway
some concurrent changes Jan was making to the bufmgr. Here's an updated version of the patch -- it should apply cleanly to CVS HEAD and passes the regression tests. This patch makes the following changes: - remove the UnlockAndReleaseBuffer() and UnlockAndWriteBuffer() macros, and replace uses of them with calls to the appropriate functions. - remove a bunch of #ifdef BMTRACE code: it is ugly & broken (i.e. it doesn't compile) - make BufferReplace() return a bool, not an int - cleanup some logic in bufmgr.c; should be functionality equivalent to the previous code, just cleaner now - remove the BM_PRIVATE flag as it is unused - improve a few comments, etc.
2003-12-12This patch properly sets the prototype for the on_shmem_exit andPeter Eisentraut
on_proc_exit functions, and adjust all other related code to use the proper types too. by Kurt Roeckx
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-11-24Overdue code review for ALTER SEQUENCE patch. Don't generate illegal NodeTom Lane
tree for CYCLE option; don't assume zeros are invalid values for sequence fields other than increment_by; don't reset cache_value when not told to; simplify code for testing whether to apply defaults.
2003-11-21COMMENT ON casts, conversions, languages, operator classes, andTom Lane
large objects. Dump all these in pg_dump; also add code to pg_dump user-defined conversions. Make psql's large object code rely on the backend for inserting/deleting LOB comments, instead of trying to hack pg_description directly. Documentation and regression tests added. Christopher Kings-Lynne, code reviewed by Tom
2003-11-19Background writer processJan Wieck
This first part of the background writer does no syncing at all. It's only purpose is to keep the LRU heads clean so that regular backends seldom to never have to call write(). Jan
2003-11-132nd try for the ARC strategy.Jan Wieck
I added a couple more Assertions while tracking down the exact cause of the former bug. All 93 regression tests pass now. Jan
2003-11-13ARC strategy backed out ... sorryJan Wieck
Jan
2003-11-13Replacement of the buffer replacement strategy with an ARCJan Wieck
algorithm adopted for PostgreSQL. Jan
2003-11-12Cross-data-type comparisons are now indexable by btrees, pursuant to myTom Lane
pghackers proposal of 8-Nov. All the existing cross-type comparison operators (int2/int4/int8 and float4/float8) have appropriate support. The original proposal of storing the right-hand-side datatype as part of the primary key for pg_amop and pg_amproc got modified a bit in the event; it is easier to store zero as the 'default' case and only store a nonzero when the operator is actually cross-type. Along the way, remove the long-since-defunct bigbox_ops operator class.
2003-11-09Add operator strategy and comparison-value datatype fields to ScanKey.Tom Lane
Remove the 'strategy map' code, which was a large amount of mechanism that no longer had any use except reverse-mapping from procedure OID to strategy number. Passing the strategy number to the index AM in the first place is simpler and faster. This is a preliminary step in planned support for cross-datatype index operations. I'm committing it now since the ScanKeyEntryInitialize() API change touches quite a lot of files, and I want to commit those changes before the tree drifts under me.
2003-11-06Implement isolation levels read uncommitted and repeatable read as actingPeter Eisentraut
like the next higher one.
2003-10-18Simplify loop test to avoid bug in AIX compiler, per Andreas.Tom Lane
2003-10-17Adjust display of actual runtimes in EXPLAIN output to use three fractionalTom Lane
digits, and label it 'ms' not 'msec', for consistency with psql's \timing display. Per recent discussions.
2003-10-16Fix bad interaction between NOTIFY processing and V3 extended queryTom Lane
protocol, per report from Igor Shevchenko. NOTIFY thought it could do its thing if transaction blockState is TBLOCK_DEFAULT, but in reality it had better check the low-level transaction state is TRANS_DEFAULT as well. Formerly it was not possible to wait for the client in a state where the first is true and the second is not ... but now we can have such a state. Minor cleanup in StartTransaction() as well.
2003-10-13Back out makeNode() patch to fix gcc 3.3.1 warning.Bruce Momjian
2003-10-13Adjust setRelhassubclassInRelation() to not perform actual heap_updateTom Lane
when the pg_class.relhassubclass value is already correct. This should avoid most cases of the 'tuple concurrently updated' problem that Robert Creager recently complained about. Also remove a bunch of dead code in StoreCatalogInheritance() --- it was still computing the complete list of direct and indirect inheritance ancestors, though that list has not been needed since we got rid of the pg_ipl catalog.
2003-10-12Use makeNode() to allocate structures that have to be cast to Node *,Bruce Momjian
rather than allocating them on the stack. Fixes complaint from gcc 3.3.1.
2003-10-11Back out -fstrict-aliasing void* casting.Bruce Momjian
2003-10-11This patch will stop gcc from issuing warnings about type-punned objectsBruce Momjian
when -fstrict-aliasing is turned on, as it is in the latest gcc when you use -O2 Andrew Dunstan
2003-10-06During ALTER TABLE ADD FOREIGN KEY, try to check the existing rows usingTom Lane
a single LEFT JOIN query instead of firing the check trigger for each row individually. Stephan Szabo, with some kibitzing from Tom Lane and Jan Wieck.
2003-10-06Modify COPY FROM to match the null-value string against the column valueTom Lane
before it is de-backslashed, not after. This allows the null string \N to be reliably distinguished from the data value \N (which must be represented as \\N). Per bug report from Manfred Koizar ... but it's amazing this hasn't been reported before ... Also, be consistent about encoding conversion for null string: the form specified in the command is in the server encoding, but what is sent to/from client must be in client encoding. This never worked quite right before either.
2003-10-02Add a bit more locking to vac_update_relstats and vac_update_dbstatsTom Lane
to make them comparable to what UpdateStats does in the same situation. I'm not certain two instances of vac_update_relstats could run in parallel for the same relation, but parallel invocations of vac_update_dbstats do seem possible.
2003-10-02String fixes/improvements found by Alvaro HerreraPeter Eisentraut
2003-10-02Change some notices to warnings and vice versa according to criteriaPeter Eisentraut
developed on -hackers.