summaryrefslogtreecommitdiff
path: root/src/backend/utils
AgeCommit message (Collapse)Author
2004-08-28Fix relcache to account properly for subtransaction status of 'new'Tom Lane
relcache entries. Also, change TransactionIdIsCurrentTransactionId() so that if consulted during transaction abort, it will not say that the aborted xact is still current. (It would be better to ensure that it's never called at all during abort, but I'm not sure we can easily guarantee that.) In combination, these fix a crash we have seen occasionally during parallel regression tests of 8.0.
2004-08-28Further tightening of the array literal parser. Prevent junkJoe Conway
from being accepted after the outer right brace. Per report from Markus Bertheau. Also add regression test cases for this change, and for previous recent array literal parser changes.
2004-08-27Introduce local hash table for lock state, as per recent proposal.Tom Lane
PROCLOCK structs in shared memory now have only a bitmask for held locks, rather than counts (making them 40 bytes smaller, which is a good thing). Multiple locks within a transaction are counted in the local hash table instead, and we have provision for tracking which ResourceOwner each count belongs to. Solves recently reported problem with memory leakage within long transactions.
2004-08-25Revise ResourceOwner code to avoid accumulating ResourceOwner objectsTom Lane
for every command executed within a transaction. For long transactions this was a significant memory leak. Instead, we can delete a portal's or subtransaction's ResourceOwner immediately, if we physically transfer the information about its locks up to the parent owner. This does not fully solve the leak problem; we need to do something about counting multiple acquisitions of the same lock in order to fix it. But it's a necessary step along the way.
2004-08-22Tweak code so that pg_subtrans is never consulted for XIDs older thanTom Lane
RecentXmin (== MyProc->xmin). This ensures that it will be safe to truncate pg_subtrans at RecentGlobalXmin, which should largely eliminate any fear of bloat. Along the way, eliminate SubTransXidsHaveCommonAncestor, which isn't really needed and could not give a trustworthy result anyway under the lookback restriction. In an unrelated but nearby change, #ifdef out GetUndoRecPtr, which has been dead code since 2001 and seems unlikely to ever be resurrected.
2004-08-20> After all that about numbering centuries and millenia correctly,Bruce Momjian
> why does CVS tip still give me > > regression=# select extract(century from now()); > date_part > ----------- > 20 > (1 row) > [ ... looks in code ... ] > > Apparently it's because you fixed only timestamp_part, and not > timestamptz_part. I'm not too sure about what timestamp_trunc or > timestamptz_trunc should do, but they may be wrong as well. Sigh... as usual, what is not tested does not work:-( > Could we have a more complete patch? Please find a submission attached. I hope it really fixes all decade, century and millenium issues for extract and *_trunc functions on interval and other timestamp types. If someone could check that the results are reasonnable, it would be great. I indeed overlooked the fact that there were two functions. The patch fixes the code so that both variants agree. I added comments to interval extractions, because it relies on the C division to have a negative remainder: -7/10 = 0 and remains -7. As for *_trunc functions, I have chosen to put the first year of the century or millennium: -100, 1, 101... 1001 2001 etc. Indeed, I don't think it would make sense to put 2000 (last year of the 2nd millennium) for rounding all years of the third millenium. I also fixed the code so that all decades last 10 years and decade 199 means the 1990's. I have added some tests that are relevant to deal with tricky cases. The formula may be simplified, but all these cases must pass. Please keep them. Fabien Coelho
2004-08-19Repair some issues with column aliases and RowExpr construction in theTom Lane
presence of dropped columns. Document the already-presumed fact that eref aliases in relation RTEs are supposed to have entries for dropped columns; cause the user alias structs to have such entries too, so that there's always a one-to-one mapping to the underlying physical attnums. Adjust expandRTE() and related code to handle the case where a column that is part of a JOIN has been dropped. Generalize expandRTE()'s API so that it can be used in a couple of places that formerly rolled their own implementation of the same logic. Fix ruleutils.c to suppress display of aliases for columns that were dropped since the rule was made.
2004-08-17Standardize on the assumption that the arguments of a RowExpr correspondTom Lane
to the physical layout of the rowtype, ie, there are dummy arguments corresponding to any dropped columns in the rowtype. We formerly had a couple of places that did it this way and several others that did not. Fixes Gaetano Mendola's "cache lookup failed for type 0" bug of 5-Aug.
2004-08-16Mark server_encoding and integer_datetimes as GUC_REPORT, per previousTom Lane
proposals by Oliver Jowett. Update documentation.
2004-08-13Fix core dumps, inability to count, etc associated with canonicalize_pathTom Lane
patches.
2004-08-12Cleanup Win32 COPY handling, and move archive examples to SGML.Bruce Momjian
2004-08-12Add make_native_path() because Win32 COPY is an internal CMD.EXE commandBruce Momjian
and doesn't process forward slashes in the same way as external commands. Quoting the first argument to COPY does not convert forward to backward slashes, but COPY does properly process quoted forward slashes in the second argument. Win32 COPY works with quoted forward slashes in the first argument only if the current directory is the same as the directory of the first argument.
2004-08-11Avoid crashing when restoring a saved GUC session_authorization valueTom Lane
that refers to a now-deleted userid. Per gripe from Chris Ochs.
2004-08-11Work around broken strtod() that's present in many Solaris releases.Tom Lane
Thanks to Michael Fuhr for identifying the problem.
2004-08-08Make listen_addresses be a comma-separated list instead of a space-separatedTom Lane
list. More consistent with our other list-containing GUC variables.
2004-08-08Document background writer control parameters, do some editorial workTom Lane
on other recent changes in runtime parameter list.
2004-08-08Disable vacuum delay, as discussed on hackers.Bruce Momjian
2004-08-08Allow libpgport to call memory allocation routines even thoughBruce Momjian
CurrentMemoryContext is DLLIMPORT on Win32. Work around that by creating stubs in the backend for palloc/pstrdup. Also fix pg_dumpall to do proper quoting on Win32.
2004-08-08Tighened up syntax checking of array input processing considerably. Junk thatJoe Conway
was previously allowed in odd places with odd results now causes an ERROR. Also changed behavior with respect to whitespace -- trailing whitespace is now ignored as well as leading whitespace (which has always been ignored). Documentation updated to reflect change in whitespace handling. Also some refactoring to what I believe is a more sensible order of several paragraphs.
2004-08-07Vacuum delay activated by default.Jan Wieck
Jan
2004-08-07Document delay as 0, per Matthew T. O'ConnorBruce Momjian
2004-08-06Use one, not zero, as the default lower bound for arrays of AclItems.Tom Lane
This avoids changing the displayed appearance of ACL columns now that array_out decorates its output with bounds information when the lower bound isn't one. Per gripe from Gaetano Mendola. Note that I did not force initdb for this, although any database initdb'd in the last couple of days is going to have some problems.
2004-08-06Rename vacuum_cost_naptime to vacuum_cost_delay, with agreement from Jan.Bruce Momjian
2004-08-05Create a built-in log rotation program, so that we no longer have toTom Lane
recommend that people go get Apache's rotatelogs program. Additional benefits are that configuration is done through GUC, rather than externally, and that the postmaster can monitor the log rotator and restart it after failure (though we certainly hope that won't happen often). Andreas Pflug, some rework by Tom Lane.
2004-08-05Require that array literals produce "rectangular" arrays, i.e. all theJoe Conway
subarrays of a given dimension have the same number of elements/subarrays. Also repair a longstanding undocumented (as far as I can see) ability to explicitly set array bounds in the array literal syntax. It now can deal properly with negative array indicies. Modify array_out so that arrays with non-standard lower bounds (i.e. not 1) are output with the expicit dimension syntax. This fixes a longstanding issue whereby arrays with non-default lower bounds had them changed to default after a dump/reload cycle. Modify regression tests and docs to suit, and add some minimal documentation regarding the explicit dimension syntax.
2004-08-04Label CVS tip as 8.0devel instead of 7.5devel. Adjust various commentsTom Lane
and documentation to reference 8.0 instead of 7.5.
2004-08-04Add LOG_NOWAIT flag to openlog() call, per my note of 2004-06-24.Tom Lane
2004-08-04record_out and friends need to cope with dropped columns in the rowTom Lane
datatype. Per example from Gaetano Mendola, 2004-07-25.
2004-08-03Add functions pg_start_backup, pg_stop_backup to create backup labelTom Lane
and history files as per recent discussion. While at it, remove pg_terminate_backend, since we have decided we do not have time during this release cycle to address the reliability concerns it creates. Split the 'Miscellaneous Functions' documentation section into 'System Information Functions' and 'System Administration Functions', which hopefully will draw the eyes of those looking for such things.
2004-08-02Fix not-quite-right Assertion. Did not work at all in extended-queryTom Lane
mode (per complaint from Kris Jurka) and it was only by chance that it didn't fail in simple-query mode. A COMMIT or ROLLBACK has to be executed by a portal, therefore it's wrong to suppose that there aren't any live portals at CleanupTransaction time.
2004-08-02While perusing SQL92 I realized that we are delivering the wrong SQLSTATETom Lane
error code for string-too-long errors. It should be STRING_DATA_RIGHT_TRUNCATION not STRING_DATA_LENGTH_MISMATCH. The latter probably should only be applied to cases where a string must be exactly so many bits --- there are no cases at all where it applies to character strings, only bit strings.
2004-08-02Support USING INDEX TABLESPACE clause for PRIMARY KEY and UNIQUETom Lane
constraints. Christopher Kings-Lynne.
2004-08-01Cause ALTER OWNER commands to update the object's ACL, replacing referencesTom Lane
to the old owner with the new owner. This is not necessarily right, but it's sure a lot more likely to be what the user wants than doing nothing. Christopher Kings-Lynne, some rework by Tom Lane.
2004-08-01Some mop-up work for savepoints (nested transactions). Store a smallTom Lane
number of active subtransaction XIDs in each backend's PGPROC entry, and use this to avoid expensive probes into pg_subtrans during TransactionIdIsInProgress. Extend EOXactCallback API to allow add-on modules to get control at subxact start/end. (This is deliberately not compatible with the former API, since any uses of that API probably need manual review anyway.) Add basic reference documentation for SAVEPOINT and related commands. Minor other cleanups to check off some of the open issues for subtransactions. Alvaro Herrera and Tom Lane.
2004-07-31Restructure error handling as recently discussed. It is now reallyTom Lane
possible to trap an error inside a function rather than letting it propagate out to PostgresMain. You still have to use AbortCurrentTransaction to clean up, but at least the error handling itself will cooperate.
2004-07-28Revert ill-conceived patch that made elog(FATAL) the same as elog(ERROR)Tom Lane
followed by seeing EOF from client. If we want a safe session-kill capability we will need to write one, not break our error handling mechanism.
2004-07-28Fix subtransaction behavior for large objects, temp namespace, files,Tom Lane
password/group files. Also allow read-only subtransactions of a read-write parent, but not vice versa. These are the reasonably noncontroversial parts of Alvaro's recent mop-up patch, plus further work on large objects to minimize use of the TopTransactionResourceOwner.
2004-07-24log_destination should only be PGC_SIGHUP, not PGC_POSTMASTER, as perTom Lane
discussion yesterday. Also a few improvements in the associated documentation.
2004-07-21Back out pg_autovacuum commit after cvs clean failure causes commit.Bruce Momjian
2004-07-21lease find enclosed a patch that matches the PL/Perl documentationBruce Momjian
(fairly closely, I hope) to the current PL/Perl implementation. David Fetter
2004-07-19Here is another patch that fixes a stack of pg_dump bugs:Bruce Momjian
* Fix help text ordering * Add back --set-session-authorization to pg_dumpall. Updated the docs for that. Updated help for that. * Dump ALTER USER commands for the cluster owner ("pgsql"). These are dumped AFTER the create user and create database commands in case the permissions to do these have been revoked. * Dump ALTER OWNER for public schema (because it's possible to change it). This was done by adding TOC entries for the public schema, and filtering them out at archiver time. I also save the owner in the TOC entry just for the public schema. * Suppress dumping single quotes around schema_path and DateStyle options when they are set using ALTER USER or ALTER DATABASE. Added a comment to the steps in guc.c to remind people to update that list. * Fix dumping in --clean mode against a pre-7.3 server. It just sets all drop statements to assume the public schema, allowing it to restore without error. * Cleaned up text output. eg. Don't output -- Tablespaces comment if there are none. Same for groups and users. * Make the commands to DELETE FROM pg_shadow and DELETE FROM pg_group only be output when -c mode is enabled. I'm not sure why that hasn't been done before?!?! This should be good for application asap, after which I will start on regression dumping 7.0-7.4 databases. Christopher Kings-Lynne
2004-07-19XLOG file archiving and point-in-time recovery. There are still someTom Lane
loose ends and a glaring lack of documentation, but it basically works. Simon Riggs with some editorialization by Tom Lane.
2004-07-17Invent ResourceOwner mechanism as per my recent proposal, and use it toTom Lane
keep track of portal-related resources separately from transaction-related resources. This allows cursors to work in a somewhat sane fashion with nested transactions. For now, cursor behavior is non-subtransactional, that is a cursor's state does not roll back if you abort a subtransaction that fetched from the cursor. We might want to change that later.
2004-07-12Add has_tablespace_privilege().Bruce Momjian
Christopher Kings-Lynne
2004-07-12Fix library_path with canonicalization.Bruce Momjian
2004-07-12Canonicalize preload_libraries after it is split up, not before.Bruce Momjian
2004-07-11Cleanup for canonicalization fixes, from Tom.Bruce Momjian
2004-07-11Remove postgresql.conf of 'info' as a valid client_min_messages level.Bruce Momjian
2004-07-11Use canonicalize_path for -D, GUC paths, and paths coming in fromBruce Momjian
environment variables.
2004-07-11Cause the format of BC timestamptz output to be 'datetime zone BC' ratherTom Lane
than 'datetime BC zone', because the former is accepted by the timestamptz input converter while the latter may not be depending on spacing. This is not a loss of compatibility w.r.t. 7.4 and before, because until very recently there was never a case where we'd output both zone and 'BC'.