summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2007-01-24Relax an Assert() that has been found to be too strict in some situationsTom Lane
involving unions of types having typmods. Variants of the failure are known to occur in 8.1 and up; not sure if it's possible in 8.0 and 7.4, but since the code exists that far back, I'll just patch 'em all. Per report from Brian Hurt.
2007-01-20Add documentation of memory and time units to postgresql.conf.Bruce Momjian
Backpatch to 8.2.X for new initdbs.
2007-01-16Fix incorrect permissions check in information_schema.key_column_usage view:Tom Lane
it was checking a pg_constraint OID instead of pg_class OID, resulting in "relation with OID nnnnn does not exist" failures for anyone who wasn't owner of the table being examined. Per bug #2848 from Laurence Rowe. Note: for existing 8.2 installations a simple version update won't fix this; the easiest fix is to CREATE OR REPLACE this view with the corrected definition.
2007-01-12Fix handling of CC (century) format spec in to_date/to_char. According toTom Lane
standard convention the 21st century runs from 2001-2100, not 2000-2099, so make it work like that. Per bug #2885 from Akio Iwaasa. Backpatch to 8.2, but no further, since this is really a definitional change; users of older branches are probably more interested in stability.
2007-01-11Fix a performance problem in databases with large numbers of tablesTom Lane
(or other types of pg_class entry): the function pgstat_vacuum_tabstat, invoked during VACUUM startup, had runtime proportional to the number of stats table entries times the number of pg_class rows; in other words O(N^2) if the stats collector's information is reasonably complete. Replace list searching with a hash table to bring it back to O(N) behavior. Per report from kim at myemma.com. Back-patch as far as 8.1; 8.0 and before use different coding here.
2007-01-11Allow Borland CC to compile libpq and psql.Bruce Momjian
Backpatch to 8.2.X. L Bayuk
2007-01-08Tweak joinlist creation to avoid generating useless one-element subproblemsTom Lane
when collapsing of JOIN trees is stopped by join_collapse_limit. For instance a list of 11 LEFT JOINs with limit 8 now produces something like ((1 2 3 4 5 6 7 8) 9 10 11 12) instead of (((1 2 3 4 5 6 7 8) (9)) 10 11 12) The latter structure is really only required for a FULL JOIN. Noted while studying an example from Shane Ambler.
2007-01-08Remove cost_hashjoin's very ancient hack to discourage (once, entirely forbid)Tom Lane
hash joins with the estimated-larger relation on the inside. There are several cases where doing that makes perfect sense, and in cases where it doesn't, the regular cost computation really ought to be able to figure that out. Make some marginal tweaks in said computation to try to get results approximating reality a bit better. Per an example from Shane Ambler. Also, fix an oversight in the original patch to add seq_page_cost: the costs of spilling a hash join to disk should be scaled by seq_page_cost.
2007-01-07Fix oversight in handling of row-comparison index keys: if the row comparisonTom Lane
doesn't exactly match the index, we may have to change our initial positioning strategy. For example, given an index on (f1,f2,f3) and a WHERE condition "ROW(f1,f3) > ROW(2,3)", the code extracted the initial-positioning condition "f1 > 2", which is wrong ... it has to be "f1 >= 2", else some rows matching the WHERE condition may fail to be returned. Applying patch to 8.2 only --- I'll fix it in HEAD later as part of the planned index improvements (reverse-sort and NULLS FIRST/LAST work).
2007-01-06Fix filtered_base_yylex() to save and restore base_yylval and base_yyllocTom Lane
properly when doing a lookahead. The lack of this was causing various interesting misbehaviors when one tries to use "with" as a plain identifier.
2007-01-05Stamp release 8.2.1. Update FAQs.Bruce Momjian
2007-01-04Tweak pg_dumpall to add GRANT CONNECT ON DATABASE ... TO PUBLIC when dumpingTom Lane
database privileges from a pre-8.2 server. This ensures that the reloaded database will maintain the same behavior it had in the previous installation, ie, everybody has connect privilege. Per gripe from L Bayuk.
2007-01-04Fix erroneous implementation of -s in postmaster.c (the switch doesn't takeTom Lane
an optarg). Add some comments noting that code in three different files has to be kept in sync. Fix erroneous description of -S switch (it sets work_mem not silent_mode), and do some light copy-editing elsewhere in postgres-ref.
2007-01-03Fix regex_fixed_prefix() to cope reasonably well with regex patterns of theTom Lane
form '^(foo)$'. Before, these could never be optimized into indexscans. The recent changes to make psql and pg_dump generate such patterns (for \d commands and -t and related switches, respectively) therefore represented a big performance hit for people with large pg_class catalogs, as seen in recent gripe from Erik Jones. While at it, be more paranoid about case-sensitivity checking in multibyte encodings, and fix some other corner cases in which a regex might be interpreted too liberally.
2006-12-28Add a defense to prevent core dumps if 8.2 version of rank_cd() is used withTom Lane
the 8.1 SQL function definition for it. Per report from Rajesh Kumar Mallah, such a DBA error doesn't seem at all improbable, and the cost of checking for it is not very high compared to the cost of running this function. (It would have been better to change the C name of the function so it wouldn't be called by the old SQL definition, but it's too late for that now in the 8.2 branch.)
2006-12-28Revert exports.list change pending closer study.Tom Lane
2006-12-27Use a more backward-compatible syntax for exports.list on Linux.Tom Lane
Per Thorkil Olesen.
2006-12-27Modify local buffer management to request memory for local buffers in blocksTom Lane
of increasing size, instead of one at a time. This reduces the memory management overhead when num_temp_buffers is large: in the previous coding we would actually waste 50% of the space used for temp buffers, because aset.c would round the individual requests up to 16K. Problem noted while studying a performance issue reported by Steven Flatt. Back-patch as far as 8.1 --- older versions used few enough local buffers that the issue isn't significant for them.
2006-12-27Print combining characters (those reported as having zero width byTom Lane
PQdsplen()) normally, instead of replacing them by \uXXXX sequences. Assume that they in fact occupy zero screen space for formatting purposes. Per gripe from Michael Fuhr and ensuing discussion.
2006-12-26Fix failure due to accessing an already-freed tuple descriptor in a planTom Lane
involving HashAggregate over SubqueryScan (this is the known case, there may well be more). The bug is only latent in releases before 8.2 since they didn't try to access tupletable slots' descriptors during ExecDropTupleTable. The least bogus fix seems to be to make subqueries share the parent query's memory context, so that tupdescs they create will have the same lifespan as those of the parent query. There are comments in the code envisioning going even further by not having a separate child EState at all, but that will require rethinking executor access to range tables, which I don't want to tackle right now. Per bug report from Jean-Pierre Pelletier.
2006-12-26Repair bug #2839: the various ExecReScan functions need to resetTom Lane
ps_TupFromTlist in plan nodes that make use of it. This was being done correctly in join nodes and Result nodes but not in any relation-scan nodes. Bug would lead to bogus results if a set-returning function appeared in the targetlist of a subquery that could be rescanned after partial execution, for example a subquery within EXISTS(). Bug has been around forever :-( ... surprising it wasn't reported before.
2006-12-26Repair bug #2836: SPI_execute_plan returned zero if none of the querytreesTom Lane
were marked canSetTag. While it's certainly correct to return the result of the last one that is marked canSetTag, it's less clear what to do when none of them are. Since plpgsql will complain if zero is returned, the 8.2.0 behavior isn't good. I've fixed it to restore the prior behavior of returning the physically last query's result code when there are no canSetTag queries.
2006-12-24Make HISTCONTROL=ignoredups work again (broken by misordering ofTom Lane
operations during recent code refactoring). Per bug #2840 from Ned Crigler.
2006-12-15Fix some planner bugs exposed by reports from Arjen van der Meijden. TheseTom Lane
are all in new-in-8.2 logic associated with indexability of ScalarArrayOpExpr (IN-clauses) or amortization of indexscan costs across repeated indexscans on the inside of a nestloop. In particular: Fix some logic errors in the estimation for multiple scans induced by a ScalarArrayOpExpr indexqual. Include a small cost component in bitmap index scans to reflect the costs of manipulating the bitmap itself; this is mainly to prevent a bitmap scan from appearing to have the same cost as a plain indexscan for fetching a single tuple. Also add a per-index-scan-startup CPU cost component; while prior releases were clearly too pessimistic about the cost of repeated indexscans, the original 8.2 coding allowed the cost of an indexscan to effectively go to zero if repeated often enough, which is overly optimistic. Pay some attention to index correlation when estimating costs for a nestloop inner indexscan: this is significant when the plan fetches multiple heap tuples per iteration, since high correlation means those tuples are probably on the same or adjacent heap pages.
2006-12-15Put JST back into the default set of timezone abbreviations;Tom Lane
was removed in an unexplainable moment of brain fade.
2006-12-14Make --with-ldap build on Unixware, per Olivier Prenant.Tom Lane
2006-12-12Fix planner to do the right thing when a degenerate outer join (one whoseTom Lane
joinclause doesn't use any outer-side vars) requires a "bushy" plan to be created. The normal heuristic to avoid joins with no joinclause has to be overridden in that case. Problem is new in 8.2; before that we forced the outer join order anyway. Per example from Teodor.
2006-12-08Avoid double free of _SPI_current->tuptable. AtEOSubXact_SPI() now tries toTom Lane
release it in a subtransaction abort, but this neglects possibility that someone outside SPI already did. Fix is for spi.c to forget about a tuptable as soon as it's handed it back to the caller. Per bug #2817 from Michael Andreen.
2006-12-07Repair incorrect placement of WHERE clauses when there are multiple,Tom Lane
rearrangeable outer joins and the WHERE clause is non-strict and mentions only nullable-side relations. New bug in 8.2, caused by new logic to allow rearranging outer joins. Per bug #2807 from Ross Cohen; thanks to Jeff Davis for producing a usable test case.
2006-12-06Fix planning of SubLinks to ensure that Vars generated from transformation ofTom Lane
a sublink's test expression have the correct vartypmod, rather than defaulting to -1. There's at least one place where this is important because we're expecting these Vars to be exactly equal() to those appearing in the subplan itself. This is a pretty klugy solution --- it would likely be cleaner to change Param nodes to include a typmod field --- but we can't do that in the already-released 8.2 branch. Per bug report from Hubert Fongarnand.
2006-12-04Fix pg_dump linking on Win32 with MSVS win32.mak:Bruce Momjian
The module link is insufficient.:-( ---- Sorry, japanese message change to xxx --- link.exe @C:\DOCUME~1\hi-saito\LOCALS~1\Temp\nmk03360. common.obj : error LNK2001: xxxxxx "_pg_qsort" xxxxxx pg_dump_sort.obj : error LNK2001: xxxxx "_pg_qsort" xxxxx .\Release\pg_dump.exe : fatal error LNK1120: xxxxxxx NMAKE : fatal error U1077: 'link.exe' : xxxxx '0x460' Stop. Hiroshi Saito
2006-12-04Patch of Win32 Encoding problem for server messages usingBruce Momjian
FormatMessage() (This should have been in 8.2.0, patched to 8.2.X and HEAD): I think this problem to be complex.... http://archives.postgresql.org/pgsql-hackers/2006-11/msg00042.php FormatMessage of windows cannot consider the encoding of the database. However, I should try the solution now. It is necessary to clear the problem. Multi character-code exists together in message and log. It doesn't consider the data base encoding that the user intended.... The user in multi-byte country can try this. http://inet.winpg.jp/~saito/pg_bug/MessageCheck.c That is, it is likely to become it in this manner.(Japanese) http://inet.winpg.jp/~saito/pg_bug/FormatMessage998.png Hiroshi Saito
2006-12-03Fix LIMIT/OFFSET for null limit values. This worked before 8.2 but was brokenTom Lane
by the change to make limit values int8 instead of int4. (Specifically, you can do DatumGetInt32 safely on a null value, but not DatumGetInt64.) Per bug #2803 from Greg Johnson.
2006-12-02Stamp 8.2, except configure.in.Bruce Momjian
2006-12-02Translation updatesPeter Eisentraut
2006-12-01Make the bgwriter's error recovery path do smgrcloseall(). On Windows thisTom Lane
should allow delete-pending files to actually go away, and thereby work around the various complaints we've seen about 'permission denied' errors in such cases. Should be reasonably harmless in any case...
2006-11-30Minor adjustments to make failures in startup/shutdown behave more cleanly.Tom Lane
StartupXLOG and ShutdownXLOG no longer need to be critical sections, because in all contexts where they are invoked, elog(ERROR) would be translated to elog(FATAL) anyway. (One change in bgwriter.c is needed to make this true: set ExitOnAnyError before trying to exit. This is a good fix anyway since the existing code would have gone into an infinite loop on elog(ERROR) during shutdown.) That avoids a misleading report of PANIC during semi-orderly failures. Modify the postmaster to include the startup process in the set of processes that get SIGTERM when a fast shutdown is requested, and also fix it to not try to restart the bgwriter if the bgwriter fails while trying to write the shutdown checkpoint. Net result is that "pg_ctl stop -m fast" does something reasonable for a system in warm standby mode, and so should Unix system shutdown (ie, universal SIGTERM). Per gripe from Stephen Harris and some corner-case testing of my own.
2006-11-30Fix bug with page deletion. If inner page is removed and it tries toTeodor Sigaev
remove page on next level linked from next inner page, ginScanToDelete() wrongly sets parent page. Bug reveals when many item pointers from index was deleted ( several hundred thousands). Bug is discovered by hubert depesz lubaczewski <depesz@gmail.com> Suppose, we need rc2 before release...
2006-11-29Fix Makefile problem which prevented installation on VPATH builds.Alvaro Herrera
2006-11-29More MSVC build support from Magnus.Tom Lane
2006-11-29Spelling fixPeter Eisentraut
2006-11-28Update timezone data to tzdata2006p zic distribution. It seems WesternTom Lane
Australia decided to institute DST with one month's notice ... way to go, politicians.
2006-11-28Mark to_char(timestamp without timezone) as stable, not immutable, since itsTom Lane
result now depends on the lc_messages setting, as noted by Bruce. Also, mark to_number() and the numeric-type variants of to_char() as stable, because their results depend on lc_numeric; this is a longstanding oversight. Also, mark to_date() and to_char(interval) as stable; although these appear not to depend on any GUC variables as of CVS HEAD, that seems a property unlikely to survive future improvements. It seems best to mark all the formatting functions stable and be done with it. catversion not bumped, because this does not seem critical enough to force a post-RC1 initdb, and anyway we cannot do so in the back branches.
2006-11-28Fix some translator comments so that xgettext finds them and pgindent doesPeter Eisentraut
not destroy them. Maybe we can adjust pgindent sometime.
2006-11-28Add workaround for localizing May and abbreviated May differently. IdeaPeter Eisentraut
of Dennis Björklund.
2006-11-28Also install ecpg_config.hMichael Meskes
2006-11-28Add $(CFLAGS) to the simplified build rule for .so libraries on Darwin.Tom Lane
Arguably we should do this on *all* platforms, but for the moment Ill
2006-11-28protect vfprintf from hijacking by Windows gettext just like other members ↵Andrew Dunstan
of the *printf family.
2006-11-27Fix gratuitous message spelling differencesPeter Eisentraut
2006-11-25update for rc1REL8_2_RC1PostgreSQL Daemon