1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-28 05:21:27 +03:00

22021 Commits

Author SHA1 Message Date
Peter Eisentraut
f575dfc230 Require a specific Autoconf version, instead of a lower bound only. 2007-11-26 12:27:03 +00:00
Alvaro Herrera
4bf3801d59 Fix buggy usage of vsnprintf in PL/Python by removing it altogether, instead
relying on stringinfo.c.  This fixes a problem reported by Marko Kreen, but I
didn't use his patch, per subsequent discussion.
2007-11-23 01:47:12 +00:00
Tatsuo Ishii
d4becb639d Fix "Overall Page Layout" table. The second row should be ItemIdData, not
ItemPointerData.
2007-11-23 00:30:58 +00:00
Tom Lane
80848c001d Prevent Perl from introducing a possibly-incompatible definition of type
"bool" into plperl.c.  This has always been a hazard since Perl allows a
platform-specific choice to define bool as int rather than char, but
evidently this didn't happen on any platform we support ... until OS X 10.5.
Per report from Brandon Maust.

Back-patch as far as 8.0 --- a bit arbitrary, but it seems unlikely anyone
will be trying to port 7.x onto new platforms.
2007-11-22 17:47:40 +00:00
Teodor Sigaev
9275f2d34c Backpatch: Fix tsvector_out() and tsquery_out() to escape backslesh, add test of that.
Patch by Bruce Momjian <bruce@momjian.us>
2007-11-16 17:09:15 +00:00
Tom Lane
011e0efc15 Update timezone data files to release 2007i of the zic database. 2007-11-15 21:21:26 +00:00
Joe Conway
0b33e2066f Have crosstab variants treat NULL rowid as a category in its own right,
per suggestion from Tom Lane. This fixes crash-bug reported by Stefan
Schwarzer.
2007-11-10 05:01:50 +00:00
Tom Lane
8d31b6d24d Second pass at improving LIKE/regex estimation in non-C locales. It turns
out that it's actually quite likely that a string that is an extension of
the given prefix will sort as larger than the "greater" string our previous
code created.  To provide some defense against that, do the comparisons
against a modified string instead of just the bare prefix.  We tack on
"Z", "z", "y", or "9", whichever is seen as largest in the current locale.
Testing suggests that this is sufficient at least for cases involving
ASCII data.
2007-11-09 20:10:20 +00:00
Tom Lane
b4b939e455 If an index depends on no columns of its table, give it a dependency on the
whole table instead, to ensure that it goes away when the table is dropped.
Per bug #3723 from Sam Mason.

Backpatch as far as 7.4; AFAICT 7.3 does not have the issue, because it doesn't
have general-purpose expression indexes and so there must be at least one
column referenced by an index.
2007-11-08 23:23:07 +00:00
Tom Lane
e4a46db10f Improve the performance of LIKE/regex estimation in non-C locales, by making
make_greater_string() try harder to generate a string that's actually greater
than its input string.  Before we just assumed that making a string that was
memcmp-greater was enough, but it is easy to generate examples where this is
not so when the locale is not C.  Instead, loop until the relevant comparison
function agrees that the generated string is greater than the input.

Unfortunately this is probably not enough to guarantee that the generated
string is greater than all extensions of the input, so we cannot relax the
restriction to C locale for the LIKE/regex index optimization.  But it should
at least improve the odds of getting a useful selectivity estimate in
prefix_selectivity().  Per example from Guillaume Smet.

Backpatch to 8.1, mainly because that's what the complainant is using...
2007-11-07 22:37:43 +00:00
Michael Meskes
607359854e Fixed two parser bugs. 2007-11-06 08:32:57 +00:00
Tom Lane
56ac701b3b Fix a couple of issues with pg_dump's handling of inheritance child tables
that have default expressions different from their parent.  First, if the
parent table's default expression has to be split out as a separate
ALTER TABLE command, we need a dependency constraint to ensure that the
child's command is given second.  This is because the ALTER TABLE on the
parent will propagate to the child.  (We can't prevent that by using ONLY on
the parent's command, since it's possible that other children exist that
should receive the inherited default.)  Second, if the child has a NULL
default where the parent does not, we have to explicitly say DEFAULT NULL on
the child in order for this state to be preserved after reload.  (The latter
actually doesn't work right because of a backend bug, but that is a separate
issue.)

Backpatch as far as 8.0.  7.x pg_dump has enough issues with altered tables
(due to lack of dependency analysis) that trying to fix this one doesn't seem
very productive.
2007-10-28 19:08:16 +00:00
Tom Lane
5808e2b173 Fix ALTER COLUMN TYPE to preserve the tablespace and reloptions of indexes
it affects.  The original coding neglected tablespace entirely (causing
the indexes to move to the database's default tablespace) and for an index
belonging to a UNIQUE or PRIMARY KEY constraint, it would actually try to
assign the parent table's reloptions to the index :-(.  Per bug #3672 and
subsequent investigation.

8.0 and 8.1 did not have reloptions, but the tablespace bug is present.
2007-10-13 15:55:58 +00:00
Tom Lane
fbe5dc4386 Ensure that the result of evaluating a function during constant-expression
simplification gets detoasted before it is incorporated into a Const node.
Otherwise, if an immutable function were to return a TOAST pointer (an
unlikely case, but it can be made to happen), we would end up with a plan
that depends on the continued existence of the out-of-line toast datum.
2007-10-11 21:28:12 +00:00
Magnus Hagander
9310b2e578 Don't try to free pgpassfile since it's a stack variable.
Martin Pitt
2007-10-09 15:03:30 +00:00
Tom Lane
56ae9c905a Keep the planner from failing on "WHERE false AND something IN (SELECT ...)".
eval_const_expressions simplifies this to just "WHERE false", but we have
already done pull_up_IN_clauses so the IN join will be done, or at least
planned, anyway.  The trouble case comes when the sub-SELECT is itself a join
and we decide to implement the IN by unique-ifying the sub-SELECT outputs:
with no remaining reference to the output Vars in WHERE, we won't have
propagated the Vars up to the upper join point, leading to "variable not found
in subplan target lists" error.  Fix by adding an extra scan of in_info_list
and forcing all Vars mentioned therein to be propagated up to the IN join
point.  Per bug report from Miroslav Sulc.
2007-10-04 20:45:02 +00:00
Tom Lane
bc0179e02b Update timezone data files to release 2007h of the zic database.
Might as well have the latest when we wrap 8.3beta1.
2007-10-04 19:07:14 +00:00
Tom Lane
d218e2332b Defend against openssl libraries that fail on keys longer than 128 bits;
which is the case at least on some Solaris versions.  Marko Kreen
2007-09-29 15:50:07 +00:00
Tom Lane
9618af7b27 Make archive recovery always start a new timeline, rather than only when a
recovery stop time was used.  This avoids a corner-case risk of trying to
overwrite an existing archived copy of the last WAL segment, and seems
simpler and cleaner all around than the original definition.  Per example
from Jon Colverson and subsequent analysis by Simon.
2007-09-29 01:36:29 +00:00
Teodor Sigaev
bc16ca2746 Fix crash of to_tsvector() function on huge input: compareWORD()
function didn't return correct result for word position greate than
limit.

Per report from Stuart Bishop <stuart@stuartbishop.net>
2007-09-26 10:30:53 +00:00
Alvaro Herrera
9e439d9f66 Reduce the size of memory allocations by lazy vacuum when processing a small
table, by allocating just enough for a hardcoded number of dead tuples per
page.  The current estimate is 200 dead tuples per page.

Per reports from Jeff Amiel, Erik Jones and Marko Kreen, and subsequent
discussion.
CVS: ----------------------------------------------------------------------
CVS: Enter Log.  Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: 	commands/vacuumlazy.c
CVS: ----------------------------------------------------------------------
2007-09-24 03:53:06 +00:00
Tom Lane
4de99f840b Fix bogus calculation of potential output string length in translate(). 2007-09-22 05:36:00 +00:00
Tom Lane
ac5091b6ac Fix overflow in extract(epoch from interval) for intervals exceeding 68 years.
Seems to have been introduced in 8.1 by careless SECS_PER_DAY
search-and-replace.
2007-09-16 15:56:39 +00:00
Tom Lane
1498c45806 Update release notes for last-minute fix. REL8_1_10 2007-09-16 03:03:27 +00:00
Tom Lane
be706260f0 Fix aboriginal mistake in lazy VACUUM's code for truncating away
no-longer-needed pages at the end of a table.  We thought we could throw away
pages containing HEAPTUPLE_DEAD tuples; but this is not so, because such
tuples very likely have index entries pointing at them, and we wouldn't have
removed the index entries.  The problem only emerges in a somewhat unlikely
race condition: the dead tuples have to have been inserted by a transaction
that later aborted, and this has to have happened between VACUUM's initial
scan of the page and then rechecking it for empty in count_nondeletable_pages.
But that timespan will include an index-cleaning pass, so it's not all that
hard to hit.  This seems to explain a couple of previously unsolved bug
reports.
2007-09-16 02:38:02 +00:00
Marc G. Fournier
cf45f1f4c0 update configure for 8.1.10 2007-09-14 20:23:46 +00:00
Tom Lane
b061801569 Fix markup that doesn't work in back branches. 2007-09-14 16:08:33 +00:00
Tom Lane
0fcc0224fe Minor editorialization on release notes. 2007-09-14 15:51:18 +00:00
Peter Eisentraut
eae9062283 Translation updates 2007-09-13 21:10:01 +00:00
Alvaro Herrera
07c822672b Make REINDEX DATABASE silently skip remote temp tables.
Per report from bitsandbytes88 <at> hotmail.com and subsequent discussion.

This is a back patch of a patch committed yesterday to CLUSTER and REINDEX.
REINDEX only processes user indexes as of 8.1, so we needn't backpatch this any
further.  (CLUSTER was backpatched separately all the way back to 7.4).
2007-09-12 20:21:23 +00:00
Alvaro Herrera
57dcb0f81d Fix the database-wide version of CLUSTER to silently skip temp tables of
remote sessions, instead of erroring out in the middle of the operation.

This is a backpatch of a previous fix applied to CLUSTER to HEAD and 8.2, all
the way back that it is relevant to.
2007-09-12 15:16:20 +00:00
Alvaro Herrera
073164b767 Add a CHECK_FOR_INTERRUPTS call in the site where the vacuum delay point
was removed.
2007-09-12 02:05:55 +00:00
Tom Lane
459b26f727 Sync timezone data with 2007g zic release. 2007-09-11 17:43:45 +00:00
Bruce Momjian
1116c0d4d3 Stamp releases 8.2.5, 8.1.10, 8.0.14, 7.4.18, 7.3.20.
Update FAQs for 8.2.5.
2007-09-11 17:37:08 +00:00
Bruce Momjian
07403e67dd Stamp 2007-09-11 17:19:36 +00:00
Tom Lane
4603c29e3a Make sure that open hash table scans are cleaned up when bgwriter tries to
recover from elog(ERROR).  Problem was created by introduction of hash seq
search tracking awhile back, and affects all branches that have bgwriter;
in HEAD the disease has snuck into autovacuum and walwriter too.  (Not sure
that the latter two use hash_seq_search at the moment, but surely they might
someday.)  Per report from Sergey Koposov.
2007-09-11 17:15:48 +00:00
Teodor Sigaev
8605cfaa3d Fix header's size of structs defines in ispell. 2007-09-11 13:06:28 +00:00
Alvaro Herrera
e52f4ec325 Remove the vacuum_delay_point call in count_nondeletable_pages, because we hold
an exclusive lock on the table at this point, which we want to release as soon
as possible.  This is called in the phase of lazy vacuum where we truncate the
empty pages at the end of the table.

An alternative solution would be to lower the vacuum delay settings before
starting the truncating phase, but this doesn't work very well in autovacuum
due to the autobalancing code (which can cause other processes to change our
cost delay settings).  This case could be considered in the balancing code, but
it is simpler this way.
2007-09-10 17:58:56 +00:00
Teodor Sigaev
015659330f Improve page split in rtree emulation. Now if splitted result has
big misalignement, then it tries to split page basing on distribution
of boxe's centers.

Per report from  Dolafi, Tom <dolafit@janelia.hhmi.org>
2007-09-07 17:19:52 +00:00
Tom Lane
c06e5bb7bb Fix aboriginal bug in _tarAddFile(): when complaining that the amount of data
read from the temp file didn't match the file length reported by ftello(),
the wrong variable's value was printed, and so the message made no sense.
Clean up a couple other coding infelicities while at it.
2007-08-29 16:31:51 +00:00
Michael Meskes
2169ad2208 Fixed bug in Informix define handling. 2007-08-29 13:58:51 +00:00
Tom Lane
d7e1fa482a Fix brain fade in DefineIndex(): it was continuing to access the table's
relcache entry after having heap_close'd it.  This could lead to misbehavior
if a relcache flush wiped out the cache entry meanwhile.  In 8.2 there is a
very real risk of CREATE INDEX CONCURRENTLY using the wrong relid for locking
and waiting purposes.  I think the bug is only cosmetic in 8.0 and 8.1,
because their transgression is limited to using RelationGetRelationName(rel)
in an ereport message immediately after heap_close, and there's no way (except
with special debugging options) for a cache flush to occur in that interval.
Not quite sure that it's cosmetic in 7.4, but seems best to patch anyway.

Found by trying to run the regression tests with CLOBBER_CACHE_ALWAYS enabled.
Maybe we should try to do that on a regular basis --- it's awfully slow,
but perhaps some fast buildfarm machine could do it once in awhile.
2007-08-25 19:08:31 +00:00
Tom Lane
d68b66984c Fix combo_decrypt() to throw an error for zero-length input when using a
padded encryption scheme.  Formerly it would try to access res[(unsigned) -1],
which resulted in core dumps on 64-bit machines, and was certainly trouble
waiting to happen on 32-bit machines (though in at least the known case
it was harmless because that byte would be overwritten after return).
Per report from Ken Colson; fix by Marko Kreen.
2007-08-23 16:16:05 +00:00
Tom Lane
bbb7e05c32 Fix potential access-off-the-end-of-memory in varbit_out(): it fetched the
byte after the last full byte of the bit array, regardless of whether that
byte was part of the valid data or not.  Found by buildfarm testing.
Thanks to Stefan Kaltenbrunner for nailing down the cause.
2007-08-21 02:40:18 +00:00
Tom Lane
d8cb5391c2 Repair problems occurring when multiple RI updates have to be done to the same
row within one query: we were firing check triggers before all the updates
were done, leading to bogus failures.  Fix by making the triggers queued by
an RI update go at the end of the outer query's trigger event list, thereby
effectively making the processing "breadth-first".  This was indeed how it
worked pre-8.0, so the bug does not occur in the 7.x branches.
Per report from Pavel Stehule.
2007-08-15 19:16:04 +00:00
Neil Conway
1de589bfcb Fix a gradual memory leak in ExecReScanAgg(). Because the aggregation
hash table is allocated in a child context of the agg node's memory
context, MemoryContextReset() will reset but *not* delete the child
context. Since ExecReScanAgg() proceeds to build a new hash table
from scratch (in a new sub-context), this results in leaking the
header for the previous memory context. Therefore, use
MemoryContextResetAndDeleteChildren() instead.

Credit: My colleague Sailesh Krishnamurthy at Truviso for isolating
the cause of the leak.
2007-08-08 18:07:02 +00:00
Tom Lane
6d1607dc3f Fix pg_restore to guard against unexpected EOF while reading an archive file.
Per report and partial patch from Chad Wagner.
2007-08-06 01:38:32 +00:00
Tom Lane
f99e72fa51 Suppress time zone name (%Z) when logging timestamps in xlog.c startup
on Windows.  This is yet another manifestation of the problem that Windows
returns time zone names that may be in a different encoding than we are using.
I've put a better solution in HEAD, but the back branches need a simple patch.
Per report from Hiroshi Saito.
2007-08-04 01:42:34 +00:00
Andrew Dunstan
6c77d7d73b Make sure syslogPipe runs in binary mode on Windows to avoid corrupting the pipe chunking protocol. Backport to 8.0 2007-08-02 23:18:47 +00:00
Neil Conway
cbf8f82824 Fix a memory leak in tuplestore_end(). Unlikely to be significant during
normal operation, but tuplestore_end() ought to do what it claims to do.
2007-08-02 17:48:57 +00:00