Commit Graph

2704 Commits

Author SHA1 Message Date
Tom Lane bff0422b6c Revise hash join and hash aggregation code to use the same datatype-
specific hash functions used by hash indexes, rather than the old
not-datatype-aware ComputeHashFunc routine.  This makes it safe to do
hash joining on several datatypes that previously couldn't use hashing.
The sets of datatypes that are hash indexable and hash joinable are now
exactly the same, whereas before each had some that weren't in the other.
2003-06-22 22:04:55 +00:00
Tom Lane a499725469 Allow GROUP BY, ORDER BY, DISTINCT targets to be unknown literals,
silently resolving them to type TEXT.  This is comparable to what we
do when faced with UNKNOWN in CASE, UNION, and other contexts.  It gets
rid of this and related annoyances:
	select distinct f1, '' from int4_tbl;
	ERROR:  Unable to identify an ordering operator '<' for type unknown
This was discussed many moons ago, but no one got round to fixing it.
2003-06-16 02:03:38 +00:00
Tom Lane cb02610e50 Adjust nestloop-with-inner-indexscan plan generation so that we catch
some cases of redundant clauses that were formerly not caught.  We have
to special-case this because the clauses involved never get attached to
the same join restrictlist and so the existing logic does not notice
that they are redundant.
2003-06-15 22:51:45 +00:00
Tom Lane 996fdb9af1 Cause GROUP BY clause to adopt ordering operators from ORDER BY when
both clauses specify the same targets, rather than always using the
default ordering operator.  This allows 'GROUP BY foo ORDER BY foo DESC'
to be done with only one sort step.
2003-06-15 16:42:08 +00:00
Bruce Momjian 228c02c3e5 Run autoconf/autoheader for ecpg change. 2003-06-15 04:09:18 +00:00
Bruce Momjian 62b532b736 Add thread.c for libpq threading, and hook it into libpq/configure. 2003-06-14 14:35:42 +00:00
Bruce Momjian 02d847fe9f Add --with-threads configure option to control threaded libpq. 2003-06-13 23:10:08 +00:00
Bruce Momjian b14295cfe4 Attached is the complete diff against current CVS.
Compiles on BCC 5.5 and VC++ 6.0 (with warnings).

Karl Waclawek
2003-06-12 08:15:29 +00:00
Bruce Momjian dc4ee8a833 Back out patch that got bundled into another patch. 2003-06-12 08:11:07 +00:00
Bruce Momjian a647e30ba3 New patch with corrected README attached.
Also quickly added mention that it may be a qualified schema name.

Rod Taylor
2003-06-12 08:02:57 +00:00
Bruce Momjian b4cea00a1f IPv6 cleanups.
Kurt Roeckx
Andrew Dunstan
2003-06-12 07:36:51 +00:00
Bruce Momjian e5549a272d Back out this patch because it is patched inside a later patch.
---------------------------------------------------------------------------

here is a patch that allows CIDR netmasks in pg_hba.conf. It allows two
address/mask forms:

. address/maskbits, or
. address netmask (as now)

If the patch is accepted I will submit a documentation patch to cover
it.

This is submitted by agreement with Kurt Roeckx, who has worked on a
patch that covers this and other IPv6 issues.
2003-06-12 07:00:57 +00:00
Bruce Momjian b78961b0da Here is a patch that allows CIDR netmasks in pg_hba.conf. It allows two
address/mask forms:

. address/maskbits, or
. address netmask (as now)

If the patch is accepted I will submit a documentation patch to cover
it.

This is submitted by agreement with Kurt Roeckx, who has worked on a
patch that covers this and other IPv6 issues.

Andrew Dunstan
2003-06-12 02:12:58 +00:00
Bruce Momjian acd1536d9f Up to now, SerializableSnapshot and QuerySnapshot are malloc'ed and
free'd for every transaction or statement, respectively.  This patch
puts these data structures into static memory, thus saving a few CPU
cycles and two malloc calls per transaction or (in isolation level
READ COMMITTED) per query.

Manfred Koizar
2003-06-12 01:42:21 +00:00
Bruce Momjian 0abe7431c6 This patch extracts page buffer pooling and the simple
least-recently-used strategy from clog.c into slru.c.  It doesn't
change any visible behaviour and passes all regression tests plus a
TruncateCLOG test done manually.

Apart from refactoring I made a little change to SlruRecentlyUsed,
formerly ClogRecentlyUsed:  It now skips incrementing lru_counts, if
slotno is already the LRU slot, thus saving a few CPU cycles.  To make
this work, lru_counts are initialised to 1 in SimpleLruInit.

SimpleLru will be used by pg_subtrans (part of the nested transactions
project), so the main purpose of this patch is to avoid future code
duplication.

Manfred Koizar
2003-06-11 22:37:46 +00:00
Bruce Momjian 240dc5cddc Add add_missing_from GUC variable.
Nigel J. Andrews
2003-06-11 22:13:22 +00:00
Bruce Momjian b952d61c54 Add log_min_duration_statement.
Christopher Kings-Lynne
2003-06-11 18:01:14 +00:00
Bruce Momjian 9167a566d6 Add missing DLLIMPORT for cpu_index_tuple_cost to
src/include/optimizer/cost.h.

This is required to compile the PostGIS extension module with Cygwin
http://postgis.refractions.net

Norman Vine
2003-06-11 15:01:15 +00:00
Peter Eisentraut 8a2922dcb2 Represent grant options in the information schema. 2003-06-11 09:23:55 +00:00
Bruce Momjian 65fb311a97 Add Rendezvous support to postmaster, from Chris Campbell 2003-06-11 06:56:07 +00:00
Tom Lane cdfb3d9981 freeaddrinfo2() does need two parameters after all, per comment by
Kurt Roeckx.  Add some documentation to try to prevent others from
repeating my mistake.
2003-06-09 17:59:19 +00:00
Tom Lane 6bdb7aa4db libpq can now talk to either 3.0 or 2.0 protocol servers. It first tries
protocol 3, then falls back to 2 if postmaster rejects the startup packet
with an old-format error message.  A side benefit of the rewrite is that
SSL-encrypted connections can now be made without blocking.  (I think,
anyway, but do not have a good way to test.)
2003-06-08 17:43:00 +00:00
Tom Lane e649796f12 Implement outer-level aggregates to conform to the SQL spec, with
extensions to support our historical behavior.  An aggregate belongs
to the closest query level of any of the variables in its argument,
or the current query level if there are no variables (e.g., COUNT(*)).
The implementation involves adding an agglevelsup field to Aggref,
and treating outer aggregates like outer variables at planning time.
2003-06-06 15:04:03 +00:00
Peter Eisentraut 1fed74f257 Support for Intel compiler on Linux 2003-06-05 16:07:25 +00:00
Bruce Momjian cb36e74ee6 In src/include/mb/pg_wchar.h we have:
#define PG_ENCODING_BE_LAST PG_ISO_8859_8
#define PG_ENCODING_FE_LAST PG_WIN1256

but the last client encoding in the enum list is actually PG_GB18030 and
it seems that

#define PG_ENCODING_IS_CLIEN_ONLY(_enc) \
                (((_enc) > PG_ENCODING_BE_LAST && (_enc) <= PG_ENCODING_FE_LAST)

can never be true.

I think the define should read
#define PG_ENCODING_FE_LAST PG_GB18030

On the other hand, perhaps no-one cares, because
PG_ENCODING_IS_CLIEN_ONLY is never used.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
2003-06-02 18:59:25 +00:00
Tom Lane 8a6ac83dab Fix some planner performance problems with large WHERE clauses, by
introducing new 'FastList' list-construction subroutines to use in
hot spots.  This avoids the O(N^2) behavior of repeated lappend's
by keeping a tail pointer, while not changing behavior by reversing
list order as the lcons() method would do.
2003-05-28 22:32:50 +00:00
Tom Lane 4df52b28f0 Fix things so that an error occuring during standalone-backend processing
in initdb will result in exit(1), allowing the initdb script to realize
that there's something wrong.
2003-05-28 18:19:09 +00:00
Tom Lane aae078198d In bootstrap and standalone-backend modes, do not sort LOG elevel out
of order; the 'server log' output is actually client output in these
scenarios and we ought to treat elevels the same way as in the client
case.  This allows initdb to not send backend stderr to /dev/null anymore,
which makes it much more likely that people will notice problems during
initdb.
2003-05-28 17:25:02 +00:00
Tom Lane fc8d970cbc Replace functional-index facility with expressional indexes. Any column
of an index can now be a computed expression instead of a simple variable.
Restrictions on expressions are the same as for predicates (only immutable
functions, no sub-selects).  This fixes problems recently introduced with
inlining SQL functions, because the inlining transformation is applied to
both expression trees so the planner can still match them up.  Along the
way, improve efficiency of handling index predicates (both predicates and
index expressions are now cached by the relcache) and fix 7.3 oversight
that didn't record dependencies of predicate expressions.
2003-05-28 16:04:02 +00:00
Bruce Momjian 98b6f37e47 Make debug_ GUC varables output DEBUG1 rather than LOG, and mention in
docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location.
Doc changes included.
2003-05-27 17:49:47 +00:00
Bruce Momjian 24daeb8e73 Add configure thread tests. 2003-05-27 16:36:50 +00:00
Tom Lane f45df8c014 Cause CHAR(n) to TEXT or VARCHAR conversion to automatically strip trailing
blanks, in hopes of reducing the surprise factor for newbies.  Remove
redundant operators for VARCHAR (it depends wholly on TEXT operations now).
Clean up resolution of ambiguous operators/functions to avoid surprising
choices for domains: domains are treated as equivalent to their base types
and binary-coercibility is no longer considered a preference item when
choosing among multiple operators/functions.  IsBinaryCoercible now correctly
reflects the notion that you need *only* relabel the type to get from type
A to type B: that is, a domain is binary-coercible to its base type, but
not vice versa.  Various marginal cleanup, including merging the essentially
duplicate resolution code in parse_func.c and parse_oper.c.  Improve opr_sanity
regression test to understand about binary compatibility (using pg_cast),
and fix a couple of small errors in the catalogs revealed thereby.
Restructure "special operator" handling to fetch operators via index opclasses
rather than hardwiring assumptions about names (cleans up the pattern_ops
stuff a little).
2003-05-26 00:11:29 +00:00
Tom Lane 11d5c82002 Improve implementation of btrim/ltrim/rtrim: provide a special case for
single-byte encodings, and a direct C implementation of the single-argument
forms (where spaces are always what gets trimmed).  This is in preparation
for using rtrim1() as the bpchar-to-text cast operator, but is a useful
performance improvement even if we decide not to do that.
2003-05-23 22:33:23 +00:00
Bruce Momjian 77645b99f4 Add define for missing EAI_ADDRFAMILY in BSD/OS 4.3. 2003-05-22 19:14:25 +00:00
Peter Eisentraut 6fabec242d Fix compilation on Cygwin. 2003-05-22 17:20:44 +00:00
Tom Lane c120f4ba0a Adjust configure so that extern tzname[] will be checked for
independently of whether the struct tm tm_zone member exists.
Also run autoheader, which seems not to have been done lately;
it added about three more things to pg_config.h.in than I was expecting...
2003-05-22 16:39:30 +00:00
Bruce Momjian 36adb2e095 Rename Win32 include directory from win32_include to win32. 2003-05-19 17:31:59 +00:00
Tom Lane 6d7ff848e5 Add code to test for unknown timezone names (following some ideas from
Ross Reedstrom, a couple months back) and to detect timezones that are
using leap-second timekeeping.  The unknown-zone-name test is pretty
heuristic and ugly, but it seems better than the old behavior of just
switching to GMT given a bad name.  Also make DecodePosixTimezone() a
tad more robust.
2003-05-18 01:06:26 +00:00
Bruce Momjian c42581eba3 Allow interfaces to compile under MingGW/Win32 by adding _P to symbols
in ecpg.
2003-05-16 04:59:24 +00:00
Bruce Momjian ec5e0ef791 Reorganize Win32 includes to only include <port.h> after system includes
under Win32.  Also fix other compile issues.
2003-05-16 01:57:52 +00:00
Tom Lane 5e04f3857c Revert change of inclusion order for pg_config_os.h; this broke plperl
on Linux and would have who knows what unpleasant effects on other platforms.
If you need another include file for Windows, then add it; don't go
messing with the semantics of every other port's include files.
2003-05-15 23:39:27 +00:00
Bruce Momjian bee0ac67ee Add missing win32 file --- seems best way to find these is to just
commmit then do a cvs update again.
2003-05-15 16:40:29 +00:00
Bruce Momjian 12c9423832 Allow Win32 to compile under MinGW. Major changes are:
Win32 port is now called 'win32' rather than 'win'
        add -lwsock32 on Win32
        make gethostname() be only used when kerberos4 is enabled
        use /port/getopt.c
        new /port/opendir.c routines
        disable GUC unix_socket_group on Win32
        convert some keywords.c symbols to KEYWORD_P to prevent conflict
        create new FCNTL_NONBLOCK macro to turn off socket blocking
        create new /include/port.h file that has /port prototypes, move
          out of c.h
        new /include/port/win32_include dir to hold missing include files
        work around ERROR being defined in Win32 includes
2003-05-15 16:35:30 +00:00
Peter Eisentraut 2c0556068f Indexing support for pattern matching operations via separate operator
class when lc_collate is not C.
2003-05-15 15:50:21 +00:00
Tom Lane 22c4caef12 Add text(cidr) cast, per recent discussion. I'm not bothering to
force an initdb for this.
2003-05-14 18:08:15 +00:00
Tom Lane f85f43dfb5 Backend support for autocommit removed, per recent discussions. The
only remnant of this failed experiment is that the server will take
SET AUTOCOMMIT TO ON.  Still TODO: provide some client-side autocommit
logic in libpq.
2003-05-14 03:26:03 +00:00
Tom Lane 0249c24235 More binary I/O routines. 2003-05-13 18:03:08 +00:00
Tom Lane 1c9ac7dfd0 Change pg_amop's index on (amopclaid,amopopr) to index (amopopr,amopclaid).
This makes no difference for existing uses, but allows SelectSortFunction()
and pred_test_simple_clause() to use indexscans instead of seqscans to
locate entries for a particular operator in pg_amop.  Better yet, they can
use the SearchSysCacheList() API to cache the search results.
2003-05-13 04:38:58 +00:00
Tom Lane 30f609484d Add binary I/O routines for a bunch more datatypes. Still a few to go,
but that was enough tedium for one day.  Along the way, move the few
support routines for types xid and cid into a more logical place.
2003-05-12 23:08:52 +00:00
Tom Lane ba1e066e46 Implement array_send/array_recv (binary I/O for arrays). This exposed
the folly of not passing element type to typsend/typreceive, so fix that.
2003-05-09 23:01:45 +00:00