Commit Graph

15941 Commits

Author SHA1 Message Date
Tom Lane cfc710312e Adjust TupleHashTables to use MinimalTuple format for contained tuples. 2006-06-28 17:05:49 +00:00
Teodor Sigaev 783a73168b Forget to add new file :(( 2006-06-28 12:08:35 +00:00
Teodor Sigaev 1f7ef548ec Changes
* new split algorithm (as proposed in http://archives.postgresql.org/pgsql-hackers/2006-06/msg00254.php)
  * possible call pickSplit() for second and below columns
  * add spl_(l|r)datum_exists to GIST_SPLITVEC -
    pickSplit should check its values to use already defined
    spl_(l|r)datum for splitting. pickSplit should set
    spl_(l|r)datum_exists to 'false' (if they was 'true') to
    signal to caller about using spl_(l|r)datum.
  * support for old pickSplit(): not very optimal
    but correct split
* remove 'bytes' field from GISTENTRY: in any case size of
  value is defined by it's type.
* split GIST_SPLITVEC to two structures: one for using in picksplit
  and second - for internal use.
* some code refactoring
* support of subsplit to rtree opclasses

TODO: add support of subsplit to contrib modules
2006-06-28 12:00:14 +00:00
Tom Lane a1dc5c60bc Remove embedded newline in string literal --- seems to make newer gcc
versions very unhappy, and shouldn't be there anyway.
2006-06-27 23:25:28 +00:00
Bruce Momjian 370a709c75 Add GUC update_process_title to control whether 'ps' display is updated
for every command, default to on.
2006-06-27 22:16:44 +00:00
Tom Lane 69d0a15e2a Convert hash join code to use MinimalTuple format in tuple hash table
and batch files.  Should reduce memory and I/O demands for such joins.
2006-06-27 21:31:20 +00:00
Bruce Momjian 665c5e861a Default stats_command_string to 'on', now that its overhead is minimal. 2006-06-27 19:07:50 +00:00
Tom Lane 3c71244b74 Put #ifdef NOT_USED around posix_fadvise call. We may want to resurrect
this someday, but right now it seems that posix_fadvise is immature to
the point of being broken on many platforms ... and we don't have any
benchmark evidence proving it's worth spending time on.
2006-06-27 18:59:17 +00:00
Bruce Momjian 33b4ad66c9 Revert patch, doesn't do what it should:
* %Disallow changing default expression of a SERIAL column

Dhanaraj M
2006-06-27 18:35:05 +00:00
Tom Lane cdd5178c69 Extend the MinimalTuple concept to tuplesort.c, thereby reducing the
per-tuple space overhead for sorts in memory.  I chose to replace the
previous patch that tried to write out the bare minimum amount of data
when sorting on disk; instead, just dump the MinimalTuples as-is.  This
wastes 3 to 10 bytes per tuple depending on architecture and null-bitmap
length, but the simplification in the writetup/readtup routines seems
worth it.
2006-06-27 16:53:02 +00:00
Alvaro Herrera 32ad0fc183 Clamp last_anl_tuples to n_live_tuples, in case we vacuum a table without
analyzing, so that future analyze threshold calculations don't get confused.
Also, make sure we correctly track the decrease of live tuples cause by
deletes.

Per report from Dylan Hansen, patches by Tom Lane and me.
2006-06-27 03:45:16 +00:00
Bruce Momjian dc2c25fc62 Add INCLUDING CONSTRAINTS to CREATE TABLE LIKE.
Greg Stark
2006-06-27 03:43:20 +00:00
Bruce Momjian 424b8e64c7 Disallow changing/dropping default expression of a SERIAL column
Dhanaraj M
2006-06-27 03:21:55 +00:00
Bruce Momjian ba4b9c0d8c Fix for recent Win32 pg_dump tar temp file patch.
Hiroshi Saito
2006-06-27 02:56:41 +00:00
Tom Lane 3f50ba27cf Create infrastructure for 'MinimalTuple' representation of in-memory
tuples with less header overhead than a regular HeapTuple, per my
recent proposal.  Teach TupleTableSlot code how to deal with these.
As proof of concept, change tuplestore.c to store MinimalTuples instead
of HeapTuples.  Future patches will expand the concept to other places
where it is useful.
2006-06-27 02:51:40 +00:00
Bruce Momjian fe491fb9af On Win32, use loop to create pg_dump temporary tar file in the current
directory, not in device root, for permission reasons.

Backpatch to 8.1.X.
2006-06-27 01:16:58 +00:00
Bruce Momjian 3b1790f987 Add PQescapeIdentifier() to libpq
Christopher Kings-Lynne
2006-06-27 00:03:42 +00:00
Bruce Momjian 59a853e48b Fix blank line. 2006-06-26 23:53:14 +00:00
Bruce Momjian ecae3a9689 Add comment about the use of pg_config_paths.h. 2006-06-26 18:40:50 +00:00
Tom Lane ca0d2197ca Change the row constructor syntax (ROW(...)) so that list elements foo.*
will be expanded to a list of their member fields, rather than creating
a nested rowtype field as formerly.  (The old behavior is still available
by omitting '.*'.)  This syntax is not allowed by the SQL spec AFAICS,
so changing its behavior doesn't violate the spec.  The new behavior is
substantially more useful since it allows, for example, triggers to check
for data changes with 'if row(new.*) is distinct from row(old.*)'.  Per
my recent proposal.
2006-06-26 17:24:41 +00:00
Michael Meskes 4b98d423d7 Added missing braces to prevent a segfault after usage of an undeclared cursor. 2006-06-26 14:12:02 +00:00
Bruce Momjian e56756e94e Use Unix line endings instead of DOS ones, per Magnus. 2006-06-26 12:59:44 +00:00
Bruce Momjian e2fee8cf6d Update include files to Unix newline format, per report from Magnus. 2006-06-26 12:52:12 +00:00
Bruce Momjian 217d543943 Update comment description of geo routines and move comment to more
relevant location.
2006-06-26 12:32:42 +00:00
Michael Meskes ea9ec780ed Added some more coverity report patches send in by Joachim Wieland <joe@mcknight.de>. 2006-06-26 09:20:09 +00:00
Tom Lane 2924ca6747 Tweak dynahash.c to avoid wasting memory space in non-shared hash tables.
palloc() will normally round allocation requests up to the next power of 2,
so make dynahash choose allocation sizes that are as close to a power of 2
as possible.
Back-patch to 8.1 --- the problem exists further back, but a much larger
patch would be needed and it doesn't seem worth taking any risks.
2006-06-25 18:29:49 +00:00
Michael Meskes 17bab8c3fe Moved some free() calls that coverity correctly complains about. 2006-06-25 09:38:40 +00:00
Alvaro Herrera 885a4d3d9a Our version of getopt_long does not set optarg upon detecting an error, as
opposed to what other versions apparently do, so it's not safe to print an
error message.  Besides, getopt_long itself already did, so it's redundant
anyway.
2006-06-25 04:37:55 +00:00
Bruce Momjian e970b2a62b Remove individual user copyright because the code is contributed to
PGDG:

> Yes. In fact the copyright belongs to credativ GmbH the company that
> paid Carsten for his work. As you may or may not know I'm the CEO of
> that company and can assure you that his work was contributed to the
> PostgreSQL project.
2006-06-25 01:45:32 +00:00
Bruce Momjian 199f8f2858 Fix GEVHDRSZ for Win32.
Magnus Hagander
2006-06-25 01:02:12 +00:00
Bruce Momjian d8f75d4131 Fix Win32/Cygwin problems:
After updating to the latest cvs, and also building most of the addons
(like PLs), the following patch is neededf for win32 + Visual C++.

* Switch to use the new win32 semaphore code
* Rename win32_open to pgwin32_open. win32_open collides with symbols
defined in Perl. MingW didn't detect ig, MSVC did. And it's a bit too
generic a name to export globally, imho...
* Python defines some partially broken #pragmas in the headers when
doing a debug build. Workaround.

Magnus Hagander
2006-06-25 00:18:24 +00:00
Tom Lane 50aa69a825 Fix re-inclusion of port header file on Windows, per Magnus. 2006-06-24 14:52:48 +00:00
Michael Meskes c2f3c168fb Clarified copyright notice 2006-06-23 14:50:01 +00:00
Tom Lane 69bf0a0ddd Remove dllinit.c; it was only needed for long-obsolete Cygwin versions,
and there was some question about its copyright status.
2006-06-22 23:50:35 +00:00
Tom Lane 3a04f53e7f pg_stop_backup was calling XLogArchiveNotify() twice for the newly created
backup history file.  Bug introduced by the 8.1 change to make pg_stop_backup
delete older history files.  Per report from Masao Fujii.
2006-06-22 20:42:57 +00:00
Tom Lane 39bed3b388 Standalone backends need pgstat_bestart() too, per Qingqing Zhou. 2006-06-22 14:36:12 +00:00
Tom Lane a5606579fc Move setup_cancel_handler() up near start of psql main(), where the
setup_win32_locks() call formerly was, to ensure that cancelConnLock is
valid when it needs to be.  Per Yoshiyuki Asaba.
2006-06-21 19:40:31 +00:00
Tom Lane 59fd249a30 Remove ancient kluge that kept nodeAgg.c from crashing on UPDATEs involving
aggregates.  We just disallowed that, and AFAICS there should be no other
cases where direct (non-aggregated) references to input columns are allowed
in a query with aggregation and no GROUP BY.
2006-06-21 18:39:42 +00:00
Tom Lane 1f5ca045a4 Disallow aggregate functions in UPDATE commands (unless within a sub-SELECT).
This is disallowed by the SQL spec because it doesn't have any very sensible
interpretation.  Historically Postgres has allowed it but behaved strangely.
As of PG 8.1 a server crash is possible if the MIN/MAX index optimization gets
applied; rather than try to "fix" that, it seems best to just enforce the
spec restriction.  Per report from Josh Drake and Alvaro Herrera.
2006-06-21 18:30:11 +00:00
Tom Lane e256bafaa2 Eliminate a gratuitously different wording of the 'cannot use aggregate function in check constraint' error message. 2006-06-21 18:09:53 +00:00
Tom Lane 04c5b69603 Clean up psql variable code a little: eliminate unnecessary tests in
GetVariable() and be consistent about treatment of the list header.
Motivated by noticing strspn() taking an unreasonable percentage of
runtime --- the call removed from GetVariable() was the only one that
could be in a high-usage path ...
2006-06-21 16:05:11 +00:00
Michael Meskes 3f9aace723 Added some more coverity report patches send in by Martijn van Oosterhout <kleptog@svana.org>. 2006-06-21 11:38:07 +00:00
Michael Meskes 6bba43111e Fixed small typo in changelog 2006-06-21 10:34:48 +00:00
Michael Meskes a829da152c Added fixed from the coverity report send in by Joachim Wieland <joe@mcknight.de>
Added missing error handling in a few functions in ecpglib
2006-06-21 10:24:41 +00:00
Tom Lane 27c3e3de09 Remove redundant gettimeofday() calls to the extent practical without
changing semantics too much.  statement_timestamp is now set immediately
upon receipt of a client command message, and the various places that used
to do their own gettimeofday() calls to mark command startup are referenced
to that instead.  I have also made stats_command_string use that same
value for pg_stat_activity.query_start for both the command itself and
its eventual replacement by <IDLE> or <idle in transaction>.  There was
some debate about that, but no argument that seemed convincing enough to
justify an extra gettimeofday() call.
2006-06-20 22:52:00 +00:00
Tom Lane 47a37aeebd Split definitions for md5.c out of crypt.h and into their own header
libpq/md5.h, so that there's a clear separation between backend-only
definitions and shared frontend/backend definitions.  (Turns out this
is reversing a bad decision from some years ago...)  Fix up references
to crypt.h as needed.  I looked into moving the code into src/port, but
the headers in src/include/libpq are sufficiently intertwined that it
seems more work than it's worth to do that.
2006-06-20 19:56:52 +00:00
Michael Meskes aaf125f8df Do not use already free'ed errmsg, bug found by Joachim Wieland
<joachim.wieland@credativ.de>
2006-06-19 09:19:49 +00:00
Tom Lane b13c9686d0 Take the statistics collector out of the loop for monitoring backends'
current commands; instead, store current-status information in shared
memory.  This substantially reduces the overhead of stats_command_string
and also ensures that pg_stat_activity is fully up to date at all times.
Per my recent proposal.
2006-06-19 01:51:22 +00:00
Tom Lane 1e8ae13640 Don't try to call posix_fadvise() unless <fcntl.h> supplies a declaration
for it.  Hopefully will fix core dump evidenced by some buildfarm members
since fadvise patch went in.  The actual definition of the function is not
ABI-compatible with compiler's default assumption in the absence of any
declaration, so it's clearly unsafe to try to call it without seeing a
declaration.
2006-06-18 18:30:21 +00:00
Tom Lane 22045666d6 Fix saveHistory() to not emit bogus complaint during psql exit when using
Darwin's libedit; per my proposal last August.  Also, suppress cast-away-
const warnings.
2006-06-18 17:30:48 +00:00