Tom Lane [Fri, 22 Nov 2002 22:10:01 +0000 (22:10 +0000)]
Redesign internal logic of nodeLimit so that it does not need to fetch
one more row from the subplan than the COUNT would appear to require.
This costs a little more logic but a number of people have complained
about the old implementation.
Tom Lane [Fri, 22 Nov 2002 16:25:32 +0000 (16:25 +0000)]
Fix a dozen or so places that were passing unpredictable data strings
as elog format strings. Hai-Chen Tu pointed out the problem in
contrib/dbmirror, but it wasn't the only such error.
Tom Lane [Thu, 21 Nov 2002 23:31:20 +0000 (23:31 +0000)]
Fix breakage in new-in-7.3 timetz_zone() function: was giving random
results due to doing arithmetic on uninitialized values. Add some
documentation about the AT TIME ZONE construct. Update some other
date/time documentation that seemed out of date for 7.3.
Tom Lane [Thu, 21 Nov 2002 06:36:08 +0000 (06:36 +0000)]
Code review for superuser_reserved_connections patch. Don't try to do
database access outside a transaction; revert bogus performance improvement
in SIBackendInit(); improve comments; add documentation (this part courtesy
Neil Conway).
Tom Lane [Thu, 21 Nov 2002 04:40:26 +0000 (04:40 +0000)]
NetBSD versions 1.6 and (we hope) later can use the standard geometry
comparison file, instead of geometry-positive-zeros. Per report from
Patrick Welche.
Tom Lane [Thu, 21 Nov 2002 00:42:20 +0000 (00:42 +0000)]
Finish implementation of hashed aggregation. Add enable_hashagg GUC
parameter to allow it to be forced off for comparison purposes.
Add ORDER BY clauses to a bunch of regression test queries that will
otherwise produce randomly-ordered output in the new regime.
Barry Lind [Wed, 20 Nov 2002 07:34:32 +0000 (07:34 +0000)]
Fixed bug reported by Marko Strukelj and Keith Wannamaker. Using executeBatch
on a preparedStatement would reset the prepared statment causing subsequent
uses of the preparedStatement to fail (i.e. the following series of calls
would fail: addBatch() executeBatch() addBatch() executBatch()). This is
a regression from 7.2 where this worked correctly. The regression test has
also been modified to explicitly test for this case.
Tom Lane [Tue, 19 Nov 2002 23:22:00 +0000 (23:22 +0000)]
Add an at-least-marginally-plausible method of estimating the number
of groups produced by GROUP BY. This improves the accuracy of planning
estimates for grouped subselects, and is needed to check whether a
hashed aggregation plan risks memory overflow.
Bruce Momjian [Tue, 19 Nov 2002 17:21:40 +0000 (17:21 +0000)]
Most of the code follows the American spelling of the word, which is
"canceled", so I changed the one remaining usage of the British
spelling ("cancelled") over to the former, and updated the translation
files appropriately.
Tom Lane [Fri, 15 Nov 2002 17:18:49 +0000 (17:18 +0000)]
Add relcache support for system catalogs with attnotnull columns.
The code was not making TupleConstr structs for such catalogs in
several places; with the consequence that the not-null constraint
wasn't actually enforced. With this change,
INSERT INTO pg_proc VALUES('sdf');
generates a 'Fail to add null value' error instead of a core dump.
Bruce Momjian [Fri, 15 Nov 2002 03:09:39 +0000 (03:09 +0000)]
New version attached. The following is implemented:
- CLUSTER ALL clusters all the tables that have some index with
indisclustered set and the calling user owns.
- CLUSTER tablename clusters the named table, using the index with
indisclustered set. If no index has the bit set, throws elog(ERROR).
- The multi-relation version (CLUSTER ALL) uses a multitransaction
approach, similar to what VACUUM does.
Bruce Momjian [Fri, 15 Nov 2002 03:07:52 +0000 (03:07 +0000)]
Clean up psql:
Add simple ALTER DATABASE, ALTER TRIGGER, CHECK POINT, CREATE
CONVERSION, CREATE DOMAIN, CREATE LANGUAGE, DEALLOCATE, DROP CONVERSION,
DROP DOMAIN, DROP LANGUAGE, EXECUTE, PREPARE
Complete CAST in CREATE CAST and DROP CAST but doesn't suggest what
should follow.
Add many more SET / SHOW variables to the list. Taken from SHOW ALL
output.
Complete a case sensitive search to allow \dD, \dd, \dS, \ds, \h, \H to
complete properly. But there are no matches, then try a case
insensitive search to allow case conversion. Add all missing help
options.
Tom Lane [Thu, 14 Nov 2002 19:00:36 +0000 (19:00 +0000)]
Fix planning bug introduced in recent code reorganization for hashed
aggregates: tuple_fraction has to be adjusted before passing it to
compare_fractional_path_costs().
Barry Lind [Thu, 14 Nov 2002 05:35:45 +0000 (05:35 +0000)]
Applied patch submitted by Mats Lofkvist fixing serious threading problem introduced in beta3.
Fixed bug with using setNull()(or setXXX(x, null)) and serverside prepare statements.
Improved error message when using a connection object that has already been closed.
Tom Lane [Tue, 12 Nov 2002 00:39:08 +0000 (00:39 +0000)]
Remove NO_MKTIME_BEFORE_1970. I had speculated that it was not needed
anymore given the mktime() workaround now done in DetermineLocalTimeZone.
This has now been confirmed by Robert Bruccoleri for Irix, and I'm going
to extrapolate to AIX as well.
Tom Lane [Mon, 11 Nov 2002 22:19:25 +0000 (22:19 +0000)]
Code review for ON COMMIT patch. Make the actual on-commit action happen
before commit, not after :-( --- the original coding is not only unsafe
if an error occurs while it's processing, but it generates an invalid
sequence of WAL entries. Resurrect 7.2 logic for deleting items when
no longer needed. Use an enum instead of random macros. Editorialize
on names used for routines and constants. Teach backend/nodes routines
about new field in CreateTable struct. Add a regression test.
Bruce Momjian [Sun, 10 Nov 2002 00:37:28 +0000 (00:37 +0000)]
I am attaching a patch file that will replace the previous one. It only
contains the patches to Makefile.global.in and Makefile.unixware. The
Makefile.unixware patch has been updated to include the contents of
LD_LIBRARY_PATH, if present, to the -rpath (-R) option. This change
will simplify configuring and building PostgreSQL on systems that
support LD_LIBRARY_PATH. You can set LD_LIBRARY_PATH to include all
the directorys you want to have searched for additional libraries, run
configure, then run make. The paths in LD_LIBRARY_PATH will then be
embedded in the executables via the -rpath (-R) option to the linker,
and so will not require LD_LIBRARY_PATH in order to run.
Bruce Momjian [Sun, 10 Nov 2002 00:35:58 +0000 (00:35 +0000)]
This patch makes a minor cleanup to the implementation of PERFORM in
PL/PgSQL. Previously, it had been bundled together with the assign
statement implementation, for some reason that wasn't clear to me
(they certainly don't share any code with one another). So I separated
them and made PERFORM a statement like any other. No changes in
functionality.
Along the way, I added some regression tests for PERFORM, added a
bunch more SGML tags to the PL/PgSQL docs, and removed an obsolete
comment relating to the implementation of RETURN NEXT.
Bruce Momjian [Sun, 10 Nov 2002 00:33:43 +0000 (00:33 +0000)]
> > I'll re-check that with the ppc architecture guy here.
>
> ... he is now about to write an inlined version that can go into
> s_lock.h . I'll send the new patch later on...
OK, here it comes:
An inlined version of tas(), that works for both, powerpc and
powerpc64. The patch is against 7.3b5 and passes the test suite on
both architectures.
Bruce Momjian [Sun, 10 Nov 2002 00:14:22 +0000 (00:14 +0000)]
I just discovered, that there is missing a const when passing a buffer
to PQescapeBytea and PQunescapeBytea. I fixed it and tried to create a
usable diff (I'm not so familar to diff).
Bruce Momjian [Fri, 8 Nov 2002 20:23:57 +0000 (20:23 +0000)]
This patch removes a bunch of superfluous #include directives: if
postgres.h or c.h includes a system header (such as stdio.h or
stdlib.h), there's no need to specifically include it in any of the .c
files in the backend.
Bruce Momjian [Fri, 8 Nov 2002 20:20:22 +0000 (20:20 +0000)]
The attached patch defines functions for getting distances between
points on the surface of the earth and locating points within a
specified distance using an index based on the contrib/cube package. The
new functions are all of language type sql. A couple of bugs in the old
earthdistance function based on the point datatype are fixed. A
regression test has been added for both sets of functions. The README
file has been updated to include documentation on the new stuff. There
are comments about how this package is also useful for Astronomers.
Tom Lane [Fri, 8 Nov 2002 20:09:55 +0000 (20:09 +0000)]
Revise geometry regression testing to eliminate most cross-platform
variation. To do this, set extra_float_digits to -3 in the geometry
test, and tweak the CIRCLE_TBL dataset to avoid values that suffer
from severe cancellation error (eg, circles that just touch an axis).
We still need two geometry 'expected' files to account for the
difference between platforms that display minus zero as '-0' and those
that just say '0', but with luck that's all we'll need.
Bruce Momjian [Fri, 8 Nov 2002 19:12:21 +0000 (19:12 +0000)]
Here is a patch that does just that, while maintaining the
"traditional" behavior, so the change should be transparent. Use the
command "\pset pager always" to turn it on. Anything else does the
normal toggle between "on" and "off"