Neil Conway [Tue, 25 Jan 2005 03:22:19 +0000 (03:22 +0000)]
Regression tests for recent bugfix to ALTER TABLE ADD COLUMN: ensure that
constraints on domain types are properly enforced, even if the newly
added column has no default value. Per bug #1433.
Tom Lane [Mon, 24 Jan 2005 23:21:57 +0000 (23:21 +0000)]
Fix ALTER TABLE ADD COLUMN so that constraints of domain types are
enforced properly when there is no explicit default value for the new
column. Per report from Craig Perras.
Tom Lane [Sun, 23 Jan 2005 02:21:36 +0000 (02:21 +0000)]
The result of a FULL or RIGHT join can't be assumed to be sorted by the
left input's sorting, because null rows may be inserted at various points.
Per report from Ferenc Lutischá¸n.
Tom Lane [Sun, 23 Jan 2005 00:30:26 +0000 (00:30 +0000)]
pg_dump dumped the wrong tablespace for an index (ie, the parent table's
tablespace instead of the index's own), except when the index was created
as a constraint. Report and fix by Tanida Yutaka.
Tom Lane [Sun, 23 Jan 2005 00:03:54 +0000 (00:03 +0000)]
New routine _getObjectDescription() failed to cope with some aspects of
pre-7.3 pg_dump archive files: namespace isn't there, and in some cases
te->tag may already be quotified. Per report from Alan Pevec and
followup testing.
Bruce Momjian [Sat, 22 Jan 2005 20:05:23 +0000 (20:05 +0000)]
Update count(*) discussion ideas:
< BY col {DESC} LIMIT 1. Completing this item involves making this
> BY col {DESC} LIMIT 1. Completing this item involves doing this
< invalidated if anyone modifies the table.
<
> invalidated if anyone modifies the table. Another idea is to
> get a count directly from a unique index, but for this to be
> faster than a sequential scan it must avoid access to the heap
> to obtain tuple visibility information.
>
> * Allow data to be pulled directly from indexes
>
> Currently indexes do not have enough tuple tuple visibility
> information to allow data to be pulled from the index without
> also accessing the heap. One way to allow this is to set a bit
> to index tuples to indicate if a tuple is currently visible to
> all transactions when the first valid heap lookup happens. This
> bit would have to be cleared when a heap tuple is expired.
>
Neil Conway [Sat, 22 Jan 2005 05:12:33 +0000 (05:12 +0000)]
This patch updates the regression tests to allow "make installcheck" to
pass if "default_with_oids" is set to false. I took the approach of
explicitly adding WITH OIDS to the CREATE TABLEs where necessary, rather
than tweaking the default_with_oids GUC var.
Neil Conway [Tue, 18 Jan 2005 23:25:55 +0000 (23:25 +0000)]
This patch makes some improvements to the rtree index implementation:
(1) Keep a pin on the scan's current buffer and mark buffer. This
avoids the need to do a ReadBuffer() for each tuple produced by the
scan. Since ReadBuffer() is expensive, this is a significant win.
(2) Convert a ReleaseBuffer(); ReadBuffer() pair into
ReleaseAndReadBuffer(). Surely not a huge win, but it saves a lock
acquire/release...
(3) Remove a bunch of duplicated code in rtget.c; make rtnext() handle
both the "initial result" and "subsequent result" cases.
(4) Add support for index tuple killing
(5) Remove rtscancache(): it is dead code, for the same reason that
gistscancache() is dead code (an index scan ought not be invoked with
NoMovementScanDirection).
The end result is about a 10% improvement in rtree index scan perf,
according to contrib/rtree_gist/bench.
Neil Conway [Mon, 17 Jan 2005 03:39:37 +0000 (03:39 +0000)]
This trivial patch adds a regression test for CASE expressions that use
an untyped literal in the CASE's test expression. This adds test
coverage for a bug that was fixed by Tom on January 12.
Tom Lane [Sat, 15 Jan 2005 04:15:51 +0000 (04:15 +0000)]
pg_regress now needs to know that Windows hasn't got unix sockets,
per Andrew Dunstan. Also, don't override the user's value of PGHOST
in the 'make installcheck' case. I think the latter was an ill-considered
workaround for the Windows code back when libpq didn't properly default
to localhost on Unix-socket-less platforms.
Tom Lane [Fri, 14 Jan 2005 17:47:49 +0000 (17:47 +0000)]
Add missing gettext() calls in find_my_exec(). It's probably too late
to get these strings translated, but we may as well have them be
translatable as not.
Tom Lane [Thu, 13 Jan 2005 23:07:34 +0000 (23:07 +0000)]
Change exec_eval_simple_expr's param list allocation call from
MemoryContextAllocZero back to MemoryContextAlloc, same as it was in 7.4.
The zeroing is unnecessary since all the meaningful fields are filled in
just below. I had made it do that out of neatnik-ism, but some testing
with an example provided by Pavel Stehule showed that the zeroing was
accounting for about 5% of the runtime in a compute-intensive plpgsql
function. That seems a bit high of a price for neatnik-ism...
Tom Lane [Thu, 13 Jan 2005 17:19:10 +0000 (17:19 +0000)]
get_names_for_var didn't do recursion for unnamed JOIN vars quite right;
got it wrong when the JOIN was in an outer query level. Per example from
Laurie Burrow. Also fix same issue in markTargetListOrigin. I think the
latter is only a latent bug since we currently don't apply markTargetListOrigin
except at the outer level ... but should do it right anyway.
Tom Lane [Thu, 13 Jan 2005 01:40:13 +0000 (01:40 +0000)]
Remove unportable assumption that it's okay to use the target buffer
of an sprintf() as a source string. Demonstrably does not work with
recent gcc and/or glibc on some platforms.
Tom Lane [Wed, 12 Jan 2005 17:32:36 +0000 (17:32 +0000)]
Re-allow an untyped literal as the test expression of a CASE, ie
CASE 'a' WHEN 'a' THEN 1 ELSE 2 END. This worked in 7.4 and before
but had been broken due to premature freezing of the type of the test
expression. Per gripe from GÄbor SzÃcs.
Tom Lane [Wed, 12 Jan 2005 16:38:17 +0000 (16:38 +0000)]
Increase MAXLISTEN to a more generous value, and add an error message
telling when it has been exceeded. Per trouble report from
Jean-GÅrard Pailloncy.
Tom Lane [Wed, 12 Jan 2005 16:19:51 +0000 (16:19 +0000)]
Ensure that the test postmaster started by 'make check' listens to as
few 'listen_addresses' as possible --- on most systems, none at all,
just the Unix socket. This avoids spurious check failures due to bogus
DNS setups, and is probably a good idea from a security standpoint anyway.
Per trouble report from Jean-GÅrard Pailloncy.
Teodor Sigaev [Tue, 11 Jan 2005 16:07:55 +0000 (16:07 +0000)]
Fixes:
1 Report error message instead of do nothing in case of error in regex
2 Malloced storage for mask, find and repl part of Affix. This parts may be
large enough in real life (for example in czech, thanks to moje <moje@kalhotky.net>)
Tom Lane [Mon, 10 Jan 2005 21:57:19 +0000 (21:57 +0000)]
Separate the functions of relcache entry flush and smgr cache entry flush
so that we can get the size of a shared inval message back down to what it
was in 7.4 (and simplify the logic too). Phase 2 of fixing the
'SMgrRelation hashtable corrupted' problem.
Tom Lane [Mon, 10 Jan 2005 20:02:24 +0000 (20:02 +0000)]
Phase 1 of fix for 'SMgrRelation hashtable corrupted' problem. This
is the minimum required fix. I want to look next at taking advantage of
it by simplifying the message semantics in the shared inval message queue,
but that part can be held over for 8.1 if it turns out too ugly.
Tom Lane [Mon, 10 Jan 2005 00:04:43 +0000 (00:04 +0000)]
Add some real documentation about TOAST (finally). Combine this with
the old 'page' chapter and the recently added 'filelayout' chapter to
make a coherent chapter about PostgreSQL's physical storage layout.
Tom Lane [Sun, 9 Jan 2005 21:03:19 +0000 (21:03 +0000)]
Undo an unadvertised change in the API of pg_atoi. In all previous
releases, a nonzero 'c' argument meant that the input string could be
terminated by either that character or \0. Recent refactoring broke
that, causing the thing to scan for 'c' only. This went undetected
because no part of the main code actually passes nonzero 'c'. However
it broke tsearch2 and possibly other user-written code that assumed
the old definition. Per report from Tom Hebbron.