Commit Graph

24052 Commits

Author SHA1 Message Date
Tom Lane
4e6c6a40e0 Sync timezone data with 2007e zic release. 2007-04-19 22:44:38 +00:00
Tom Lane
c0a562287b Fix missed PACKAGE_STRING. 2007-04-19 22:23:31 +00:00
Tom Lane
7fc2507f7c Repair PANIC condition in hash indexes when a previous index extension attempt
failed (due to lock conflicts or out-of-space).  We might have already
extended the index's filesystem EOF before failing, causing the EOF to be
beyond what the metapage says is the last used page.  Hence the invariant
maintained by the code needs to be "EOF is at or beyond last used page",
not "EOF is exactly the last used page".  Problem was created by my patch
of 2006-11-19 that attempted to repair bug #2737.  Since that was
back-patched to 7.4, this needs to be as well.  Per report and test case
from Vlastimil Krejcir.
2007-04-19 20:24:10 +00:00
Tom Lane
266a0ffe45 Fix plpgsql to avoid reference to already-freed memory when returning a
pass-by-reference data type and the RETURN statement is within an EXCEPTION
block.  Bug introduced by my fix of 2007-01-28 to use per-subtransaction
ExprContexts/EStates; since that wasn't back-patched into older branches,
only 8.2 and HEAD are affected.  Per report from Gary Winslow.
2007-04-19 16:33:32 +00:00
Bruce Momjian
9de4b61388 Release wording updates for releases 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19. 2007-04-19 13:03:07 +00:00
Bruce Momjian
90e4b46998 Stamp releases 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19. 2007-04-19 03:07:32 +00:00
Bruce Momjian
fe48792a11 Release note updates for 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19. 2007-04-19 02:47:52 +00:00
Peter Eisentraut
d3753aad55 Translation updates 2007-04-18 20:01:39 +00:00
Bruce Momjian
65c531df04 Update docs/error message for CSV quote/escape --- must be ASCII.
Backpatch doc change to 8.2.X.
2007-04-18 02:29:39 +00:00
Bruce Momjian
4e93443455 Document that the COPY delimiter must be an ASCII byte, rather than a
multi-byte value.  It can also be a single-byte encoded character if
the client and server versions match.

Backpatch to 8.2.X.
2007-04-18 00:18:31 +00:00
Tom Lane
2edda80720 Rewrite choose_bitmap_and() to make it more robust in the presence of
competing alternatives for indexes to use in a bitmap scan.  The former
coding took estimated selectivity as an overriding factor, causing it to
sometimes choose indexes that were much slower to scan than ones with a
slightly worse selectivity.  It was also too narrow-minded about which
combinations of indexes to consider ANDing.  The rewrite makes it pay more
attention to index scan cost than selectivity; this seems sane since it's
impossible to have very bad selectivity with low cost, whereas the reverse
isn't true.  Also, we now consider each index alone, as well as adding
each index to an AND-group led by each prior index, for a total of about
O(N^2) rather than O(N) combinations considered.  This makes the results
much less dependent on the exact order in which the indexes are
considered.  It's still a lot cheaper than an O(2^N) exhaustive search.
A prefilter step eliminates all but the cheapest of those indexes using
the same set of WHERE conditions, to keep the effective value of N down in
scenarios where the DBA has created lots of partially-redundant indexes.
2007-04-17 20:03:10 +00:00
Magnus Hagander
ff663c9606 Don't write timing output in quiet mode.
Merlin Moncure
2007-04-16 20:16:11 +00:00
Tom Lane
aeb5417633 Fix pg_dump to not crash if -t or a similar switch is used to select a serial
sequence for dumping without also selecting its owning table.  Make it not try
to emit ALTER SEQUENCE OWNED BY in this situation.
Per report from Michael Nolan.
2007-04-16 18:42:17 +00:00
Tom Lane
366e9eea24 Rearrange mdsync() looping logic to avoid the problem that a sufficiently
fast flow of new fsync requests can prevent mdsync() from ever completing.
This was an unforeseen consequence of a patch added in Mar 2006 to prevent
the fsync request queue from overflowing.  Problem identified by Heikki
Linnakangas and independently by ITAGAKI Takahiro; fix based on ideas from
Takahiro-san, Heikki, and Tom.

Back-patch as far as 8.1 because a previous back-patch introduced the problem
into 8.1 ...
2007-04-12 17:11:00 +00:00
Tom Lane
707964b6a8 Cancel pending fsync requests during WAL replay of DROP DATABASE, per bug
report from David Darville.  Back-patch as far as 8.1, which may or may not
have the problem but it seems a safe change anyway.
2007-04-12 15:04:41 +00:00
Bruce Momjian
627939c337 Backpatch doc change SYMETRIC -> SYMMETRIC, for 8.2.X. 2007-04-07 15:43:47 +00:00
Tom Lane
3ac7d76096 Fix check_sql_fn_retval to allow the case where a SQL function declared to
return void ends with a SELECT, if that SELECT has a single result that is
also of type void.  Without this, it's hard to write a void function that
calls another void function.  Per gripe from Peter.

Back-patch as far as 8.0.
2007-04-02 18:49:36 +00:00
Teodor Sigaev
100beb0dea Fix caching of unsuccessful initialization of parser or configuration.
Per report from Listmail <lists@peufeu.com>
2007-04-02 11:42:25 +00:00
Bruce Momjian
4dd2d9192d Update SSL description for when SSL root.crt/server.crt is required;
add link to libpq SSL does from server docs.

Backpatch to 8.2.X.
2007-03-30 03:19:19 +00:00
Tom Lane
0e95abd64c Fix oversight in coding of _bt_start_vacuum: we can't assume that the LWLock
will be released by transaction abort before _bt_end_vacuum gets called.
If either of these "can't happen" errors actually happened, we'd freeze up
trying to acquire an already-held lock.  Latest word is that this does
not explain Martin Pitt's trouble report, but it still looks like a bug.
2007-03-30 00:13:05 +00:00
Tom Lane
2dd336bba5 Fix typo, ensable -> enable, per Steve Gieseking. 2007-03-27 03:25:35 +00:00
Tom Lane
a467a7a910 Fix seriously broken markup for libpq-envars cross-references. 2007-03-26 17:23:45 +00:00
Tatsuo Ishii
07fe2417ab Fix pg_wchar_table's maxmblen field of EUC_CN, EUC_TW, MULE_INTERNAL
and GB18030. patches from ITAGAKI Takahiro.
2007-03-26 11:35:42 +00:00
Bruce Momjian
720a9cc0e5 Document that LDAP URLs should be double-quoted in pg_hba.conf because
commas are often present in the URL.

Backpatch to 8.2.X.
2007-03-24 21:46:25 +00:00
Tom Lane
1e0cba90fd Fix broken markup. 2007-03-24 16:46:28 +00:00
Teodor Sigaev
fc565cfc7b Fix parser bug on Windows with UTF8 encoding and C locale, the reason was
sizeof(wchar_t) = 2 instead of 4.
2007-03-22 15:59:09 +00:00
Tom Lane
60e67c1632 Fix 8.2 breakage of domains over array types, and add a regression test case
to cover it.  Per report from Anton Pikhteryev.
2007-03-19 16:30:40 +00:00
Tom Lane
32311dfaa0 SPI_cursor_open failed to enforce that only read-only queries could be
executed in read_only mode.  This could lead to various relatively-subtle
failures, such as an allegedly stable function returning non-stable results.
Bug goes all the way back to the introduction of read-only mode in 8.0.
Per report from Gaetano Mendola.
2007-03-17 03:15:47 +00:00
Alvaro Herrera
009dac8ed4 Fix uninitialized value in pgstatindex leading to invalid values being
reported in some cases.  Report and patch from Tatsuhito Kasahara.

Also fix a couple of other bugs I noticed in skimming the surrounding code.
2007-03-16 15:06:46 +00:00
Tom Lane
aef05dbec0 Fix a longstanding bug in VACUUM FULL's handling of update chains. The code
did not expect that a DEAD tuple could follow a RECENTLY_DEAD tuple in an
update chain, but because the OldestXmin rule for determining deadness is a
simplification of reality, it is possible for this situation to occur
(implying that the RECENTLY_DEAD tuple is in fact dead to all observers,
but this patch does not attempt to exploit that).  The code would follow a
chain forward all the way, but then stop before a DEAD tuple when backing
up, meaning that not all of the chain got moved.  This could lead to copying
the chain multiple times (resulting in duplicate copies of the live tuple at
its end), or leaving dangling index entries behind (which, aside from
generating warnings from later vacuums, creates a risk of wrong query
results or bogus duplicate-key errors once the heap slot the index entry
points to is repopulated).

The fix is to recheck HeapTupleSatisfiesVacuum while following a chain
forward, and to stop if a DEAD tuple is reached.  Each contiguous group
of RECENTLY_DEAD tuples will therefore be copied as a separate chain.
The patch also adds a couple of extra sanity checks to verify correct
behavior.

Per report and test case from Pavan Deolasee.
2007-03-14 18:49:04 +00:00
Tom Lane
1a72f357e3 Arrange to install a "posixrules" entry in our timezone database, so that
POSIX-style timezone specs that don't exactly match any database entry will
be treated as having correct USA DST rules.  Also, document that this can
be changed if you want to use some other DST rules with a POSIX zone spec.

We could consider changing localtime.c's TZDEFRULESTRING, but since that
facility can only deal with one DST transition rule, it seems fairly useless
now; might as well just plan to override it using a "posixrules" entry.

Backpatch as far as 8.0.  There isn't much we can do in 7.x ... either your
libc gets it right, or it doesn't.
2007-03-14 17:38:15 +00:00
Alvaro Herrera
8a7b38617a Fix a race condition that caused pg_database_size() and pg_tablespace_size()
to fail if an object was removed between calls to ReadDir() and stat().
Per discussion in pgsql-hackers.

http://archives.postgresql.org/pgsql-hackers/2007-03/msg00671.php

Bug report and patch by Michael Fuhr.
2007-03-11 06:44:11 +00:00
Magnus Hagander
5ea7b175f6 Remove unsafe calling of WSAStartup and WSACleanup from DllMain. Move the
inline cleanup call around so it will be called in the right order, and
be called on errors.

Per report from Tokuharu Yuzawa.
2007-03-08 19:27:48 +00:00
Tom Lane
8e010acb0d Fix vac_update_relstats to ensure it always sends a relcache inval message,
even if none of the fields in the pg_class row change.  This behavior is
necessary to ensure other backends flush rd_targblock values that might
point to truncated-away pages.  We got this right pre-8.2 but it was broken
by overoptimistic change to not write out the pg_class row if unchanged.
Per report from Pavan Deolasee.
2007-03-08 17:03:43 +00:00
Teodor Sigaev
2b1abc8756 Athough cube is a varlena type, nowhere was a detoasting of cube's value, so
fix it.  Add macroses DatumGetNDBOX, PG_GETARG_NDBOX and PG_RETURN_NDBOX.
Backpatch for 8.2 too.

Previous versions use version 0 calling conventions. And fmgr code detoast
values for user-defined functions.
2007-03-07 21:25:18 +00:00
Tom Lane
cafbf1e1cc Fix oversight in original coding of inline_function(): since
check_sql_fn_retval allows binary-compatibility cases, the expression
extracted from an inline-able SQL function might have a type that is only
binary-compatible with the declared function result type.  To avoid possibly
changing the semantics of the expression, we should insert a RelabelType node
in such cases.  This has only been shown to have bad consequences in recent
8.1 and up releases, but I suspect there may be failure cases in the older
branches too, so patch it all the way back.  Per bug #3116 from Greg Mullane.

Along the way, fix an omission in eval_const_expressions_mutator: it failed
to copy the relabelformat field when processing a RelabelType.  No known
observable failures from this, but it definitely isn't intended behavior.
2007-03-06 22:45:23 +00:00
Tom Lane
3530283dae Fix miscalculation of stats collector's write delay, introduced in revision 1.117. 2007-03-01 20:07:02 +00:00
Tom Lane
44089027d5 Fix markQueryForLocking() to work correctly in the presence of nested views.
It has been wrong for this case since it was first written for 7.1 :-(
Per report from Pavel Hanák.
2007-03-01 18:50:36 +00:00
Michael Meskes
bde73ab21a Backported bug fix for #2956. 2007-02-27 13:27:13 +00:00
Bruce Momjian
9395aa5392 Update Chinese FAQs to have two versions, a traditional Chinese version (Taiwan)
and a Simplified version (China (PRC)).

Backpatch to 8.2.X.

Daojing.Zhou
2007-02-21 16:42:43 +00:00
Bruce Momjian
664009ecb1 Update "encode" documentation to mention that 'escape' only changes null
bytes and backslashes, remove "ASCII" mention.  Backpatch to 8.2.X.
2007-02-20 19:59:18 +00:00
Bruce Momjian
6f9027372b Update information_schema documentation to match system tables.
Backpatch to 8.2.X.
2007-02-20 18:47:34 +00:00
Bruce Momjian
57bcfe0065 More clearly document that most PostgreSQL utilities support libpq
environment variables.  Backpatch to 8.2.X.
2007-02-20 18:11:17 +00:00
Bruce Momjian
44764fba1b Spell check on array patch. 2007-02-20 14:54:51 +00:00
Bruce Momjian
0586e9b682 Update array slice documentation to be clearer. 2007-02-20 14:34:29 +00:00
Bruce Momjian
7194ab3f55 Comment-out documentation for IS OF because it doesn't conform to the
ISO SQL behavior. Backpatch removal to 8.2.X.
2007-02-20 14:05:02 +00:00
Bruce Momjian
d9341ce1b8 Document IS [NOT] OF, which was added in 7.3. 2007-02-20 00:25:16 +00:00
Bruce Momjian
c2039e4477 Update PQfree() documentation to be clearer, backpatch to 8.2.X. 2007-02-19 22:06:30 +00:00
Magnus Hagander
7c2e6f31be Fix pg_dump on win32 to properly dump files larger than 2Gb when using
binary dump formats.
2007-02-19 15:05:21 +00:00
Tom Lane
812a929a85 Fix portal management code to support non-default command completion tags for
portals using PORTAL_UTIL_SELECT strategy.  This is currently significant only
for FETCH queries, which are supposed to include a count in the tag.  Seems
it's been broken since 7.4, but nobody noticed before Knut Lehre.
2007-02-18 19:49:30 +00:00