Commit Graph

19718 Commits

Author SHA1 Message Date
Tom Lane 595ed2a855 Make the behavior of HAVING without GROUP BY conform to the SQL spec.
Formerly, if such a clause contained no aggregate functions we mistakenly
treated it as equivalent to WHERE.  Per spec it must cause the query to
be treated as a grouped query of a single group, the same as appearance
of aggregate functions would do.  Also, the HAVING filter must execute
after aggregate function computation even if it itself contains no
aggregate functions.
2005-03-10 23:21:26 +00:00
Bruce Momjian 609e32b929 Add spinlock support for Itanium processor with Intel compiler.
Vikram Kalsi
2005-03-10 21:41:01 +00:00
Neil Conway 164adc4d39 Refactor fork()-related code. We need to do various housekeeping tasks
before we can invoke fork() -- flush stdio buffers, save and restore the
profiling timer on Linux with LINUX_PROFILE, and handle BeOS stuff. This
patch moves that code into a single function, fork_process(), instead of
duplicating it at the various callsites of fork().

This patch doesn't address the EXEC_BACKEND case; there is room for
further cleanup there.
2005-03-10 07:14:03 +00:00
Bruce Momjian e829f82223 Add comma. 2005-03-08 13:27:31 +00:00
Bruce Momjian 3716e12808 Fix markup of URL. 2005-03-08 03:52:57 +00:00
Bruce Momjian 2b26458a91 Add URL for patches queues. 2005-03-08 01:15:33 +00:00
Neil Conway 4cd2fd66f8 Unbreak out-of-tree builds, by fixing a typo. 2005-03-07 23:18:06 +00:00
Neil Conway 30c1aa06bc Replace an instance of $Id$ and an instance of $Header$ with $PostgreSQL$ 2005-03-07 22:59:43 +00:00
Bruce Momjian 61b640e35c Properly implement "Response files" for bcc. Add URL's to describe the
feature for Win32 and bcc.
2005-03-07 21:10:58 +00:00
Tom Lane a52b4fb131 Adjust creation/destruction of TupleDesc data structure to reduce the
number of palloc calls.  This has a salutory impact on plpgsql operations
with record variables (which create and destroy tupdescs constantly)
and probably helps a bit in some other cases too.
2005-03-07 04:42:17 +00:00
Bruce Momjian e3d7de6b99 Rename canonical encodings, per Peter:
UNICODE => UTF8
	ALT => WIN866
	WIN => WIN1251
	TCVN => WIN1258

The old codes continue to work.
2005-03-07 04:30:55 +00:00
Neil Conway c6ad5c2eb4 Here's a tiny fix for a harmless typo in catalog.c:
Too much space is allocated for tablespace file path, I guess the
directory name used to be "pg_tablespaces" instead of "pg_tblspc" at
some point.

Heikki Linnakangas
2005-03-07 04:15:34 +00:00
Tom Lane 1fcfa038ce Add a note that regression test row ordering differences can be caused
by non-default planner parameter settings.
2005-03-07 02:00:28 +00:00
Tom Lane 849074f9ae Revise hash join code so that we can increase the number of batches
on-the-fly, and thereby avoid blowing out memory when the planner has
underestimated the hash table size.  Hash join will now obey the
work_mem limit with some faithfulness.  Per my recent proposal
(hash aggregate part isn't done yet though).
2005-03-06 22:15:05 +00:00
Teodor Sigaev 31b6d840f6 Prevent rank change in case of duplicate search terms 2005-03-05 15:48:32 +00:00
Tom Lane 5d5087363d Replace the BufMgrLock with separate locks on the lookup hashtable and
the freelist, plus per-buffer spinlocks that protect access to individual
shared buffer headers.  This requires abandoning a global freelist (since
the freelist is a global contention point), which shoots down ARC and 2Q
as well as plain LRU management.  Adopt a clock sweep algorithm instead.
Preliminary results show substantial improvement in multi-backend situations.
2005-03-04 20:21:07 +00:00
Bruce Momjian 5592a6cf46 Move snprintf int64 compatibility letters into a NOT_USED block. 2005-03-02 23:56:53 +00:00
Tom Lane 5c2e68ba6b Fix misspelling of sysctl, per Stefan Hans. 2005-03-02 19:58:54 +00:00
Bruce Momjian 8ba5169abd Use test && test rather than test -a, per Peter. 2005-03-02 15:42:35 +00:00
Bruce Momjian f8aca046bb Fix for %I64d snprintf. 2005-03-02 15:32:39 +00:00
Bruce Momjian 022ece2cf1 snprintf() %I64d code fix. 2005-03-02 15:07:09 +00:00
Bruce Momjian bb7a3a740c Use our own snprintf() only if NLS is enabled, and support %qd and %I64d. 2005-03-02 14:48:22 +00:00
Bruce Momjian 70d4a9343f Prevent large allocation in snprintf to hold positional parameters.
Allocated size based on format string.
2005-03-02 05:22:22 +00:00
Tom Lane 3104a92866 Another go at making pred_test() handle all reasonable combinations
of AND and OR clauses.  The key point here is that an OR on the
predicate side has to be treated gingerly: we may be able to prove
that the OR is implied even when no one of its components is implied.
For example (x OR y) implies (x OR y OR z) even though no one of x,
y, or z can be individually proven.  This code handles both the
example shown recently by Sergey Koshcheyev and the one shown last
October by Dawid Kuroczko.
2005-03-02 04:10:53 +00:00
Bruce Momjian 47ea7148e3 Fix snprintf on Win32:
*  If vsnprintf() is not before snprintf() in this file, snprintf()
 *  will call the system vsnprintf() on MinGW.
2005-03-02 03:21:52 +00:00
Bruce Momjian 9989e90490 Make port snprintf.c finally thread-safe. 2005-03-02 00:02:13 +00:00
Neil Conway 87aafa1600 SGML improvements to the DML chapter. 2005-03-01 23:45:00 +00:00
Tom Lane a2ad04f4b0 Release proclock immediately in RemoveFromWaitQueue() if it represents
no held locks.  This maintains the invariant that proclocks are present
only for procs that are holding or awaiting a lock; when this is not
true, LockRelease will fail.  Per report from Stephen Clouse.
2005-03-01 21:14:59 +00:00
Tom Lane ccba1d0c9c Allow Trace_lock_oidmin to be set to zero; this is a reasonable
representation of not wanting tracing to be limited by object OID.
2005-03-01 20:23:34 +00:00
Teodor Sigaev e1662cb6b8 Simplify/clean up code for varlena types 2005-03-01 15:40:04 +00:00
Bruce Momjian 03b8efa540 Make snprintf() use already-defined int64/uint64 typedefs rather than
defining its own.
2005-03-01 05:47:28 +00:00
Bruce Momjian 5edb76d4fc Done:
> * -Make src/port/snprintf.c thread-safe
2005-03-01 05:00:20 +00:00
Tom Lane 95871703e3 Adjust OR indexscan logic to not generate redundant condition-free OR
indexscans involving partial indexes.  These would always be dominated
by a simple indexscan on such an index, so there's no point in considering
them.  Fixes overoptimism in a patch I applied last October.
2005-03-01 01:40:05 +00:00
Bruce Momjian 295dd338c3 And while we are on it, I would like to submit minor
changes to make snprintf() vsnprintf() and printf()
functions in src/port/snprintf.c thread-safe.

Nicolai Tufar
2005-03-01 00:38:11 +00:00
Tom Lane 4e89bae704 Revert the logic for expanding AND/OR conditions in pred_test() to what
it was in 7.4, and add some comments explaining why it has to be this way.
I broke it for OR'd index predicates in a fit of code cleanup last summer.
Per example from Sergey Koshcheyev.
2005-03-01 00:24:52 +00:00
Tom Lane 5c4a91c295 Un-break configure snprintf tests (partly my fault, partly Bruce's). 2005-02-28 20:55:18 +00:00
Bruce Momjian f1430ce063 Move PGAC_FUNC_PRINTF_ARG_CONTROL to just above snprintf 64-bit tests so
its output can be used to select the proper printf outputs.
2005-02-28 20:36:05 +00:00
Bruce Momjian 949ab3c9b3 snprintf.c has no sys/ioctl.h. Trivial patch below:
Magnus Hagander
2005-02-28 14:16:16 +00:00
Neil Conway 484f0464ff Implement max() and min() aggregates for array types. Patch from Koju
Iijima, reviewed by Neil Conway. Catalog version number bumped,
regression tests updated.
2005-02-28 03:45:24 +00:00
Bruce Momjian 517872c566 Because the change to gettext. Needs a bunch of new includes. Patch
follows:

Magnus Hagander
2005-02-27 22:57:17 +00:00
Bruce Momjian c5a7a6a3dc Tab indent all actions in bcc32.mak, and do it on win32.mak too for
consistency.  Backpatch only bcc32.mak to 8.0.X.
2005-02-27 22:39:52 +00:00
Neil Conway 5285b35763 Add explicit casts between int4 and boolean. Patch from Sean Chittenden,
editorializing by Neil Conway. Catalog version bumped.
2005-02-27 08:31:30 +00:00
Bruce Momjian 2d22f16132 Rename planner stats detail to avoid label confict. 2005-02-27 01:17:34 +00:00
Bruce Momjian 76fa5e6e18 Cause Win32 to output to the event log rather than stderr by default.
Magnus Hagander
2005-02-27 01:02:57 +00:00
Bruce Momjian afbc30e5d4 Allow Win32 to support the O_SYNC open flag as an wal_sync_method method.
Magnus Hagander
2005-02-27 00:53:29 +00:00
Bruce Momjian 234d50812c Add documentation on how statistics are used by the planner.
Mark Kirkwood
2005-02-27 00:49:28 +00:00
Bruce Momjian 4f51368bad Add routines to dbsize to return the index size and total relation size.
Improve documentation.

Ed L.
2005-02-26 23:31:15 +00:00
Bruce Momjian f55339577b Adjust OS-specific kernel settings to mention old and new BSD methods of
adjusting values:

> But to be on the safe side, it would make sense to do something similar
> to the BSD section, and comment about older distributions maybe needing
> to manipulate /proc/kernel/* directly.

Mark Kirkwood
2005-02-26 23:19:05 +00:00
Tom Lane 0fc4ecf935 Finish up the flat-files project: get rid of GetRawDatabaseInfo() hack
in favor of looking at the flat file copy of pg_database during backend
startup.  This should finally eliminate the various corner cases in which
backend startup fails unexpectedly because it isn't able to distinguish
live and dead tuples in pg_database.  Simplify locking on pg_database
to be similar to the rules used with pg_shadow and pg_group, and eliminate
FlushRelationBuffers operations that were used only to reduce the odds
of failure of GetRawDatabaseInfo.
initdb forced due to addition of a trigger to pg_database.
2005-02-26 18:43:34 +00:00
Bruce Momjian ffef9a9de4 Clarify PGPASSWORD usage:
! authentication.  Use of this environment variable is not
! recommended for security reasons (some operating systems
! allow non-root users to see process environment variables via
! <application>ps</>); instead consider using  the
! <filename>~/.pgpass</> file (see <xref linkend="libpq-pgpass">).
2005-02-26 18:39:04 +00:00