]> granicus.if.org Git - postgresql/log
postgresql
18 years agoTest commit.
Bruce Momjian [Mon, 10 Jul 2006 15:44:31 +0000 (15:44 +0000)]
Test commit.

18 years agoFix typo in comment.
Alvaro Herrera [Sat, 8 Jul 2006 20:45:38 +0000 (20:45 +0000)]
Fix typo in comment.

18 years agoAdd index information to /contrib/pgstattuple:
Bruce Momjian [Thu, 6 Jul 2006 02:18:07 +0000 (02:18 +0000)]
Add index information to /contrib/pgstattuple:

This is an extension of pgstattuple to query information from indexes.
It supports btree, hash and gist. Gin is not supported. It scans only
index pages and does not read corresponding heap tuples. Therefore,
'dead_tuple' means the number of tuples with LP_DELETE flag.

Also, I added an experimental feature for btree indexes. It checks
fragmentation factor of indexes. If an leaf has the right link on the
next adjacent page in the file, it is assumed to be continuous (not
fragmented). It will help us to decide when to REINDEX.

ITAGAKI Takahiro

18 years agoWIN32 fixes:
Bruce Momjian [Thu, 6 Jul 2006 02:12:32 +0000 (02:12 +0000)]
WIN32 fixes:

I take out patch for this as a promise. This is client-build support of
MS-VC6+.

Fix for different getaddrinfo structure ordering on Win32 for IPv6.

Hiroshi Saito

18 years agoBackpatch dbmirror fix for escape handling.
Bruce Momjian [Thu, 6 Jul 2006 01:57:25 +0000 (01:57 +0000)]
Backpatch dbmirror fix for escape handling.

> Upstream confirmed my reply in the last mail in [1]: the complete
> escaping logic in DBMirror.pl is seriously screwew.
>
> [1] http://archives.postgresql.org/pgsql-bugs/2006-06/msg00065.php

I finally found some time to debug this, and I think I found a better
patch than the one you proposed. Mine is still hackish and is still a
workaround around a proper quoting solution, but at least it repairs
the parsing without introducing the \' quoting again.

I consider this a band-aid patch to fix the recent security update.
PostgreSQL gurus, would you consider applying this until a better
solution is found for DBMirror.pl?

Olivier, can you please confirm that the patch works for you, too?

Backpatched to 8.0.X.

Martin Pitt

18 years agoAttached patch is required ot build with the CRT that comes with Visual
Bruce Momjian [Thu, 6 Jul 2006 01:55:51 +0000 (01:55 +0000)]
Attached patch is required ot build with the CRT that comes with Visual
Studio 2005. Basically MS defined errcode in the headers with a typedef,
so we have to #define it out of the way.

While at it, fix a function declaration in plpython that didn't match
the implementation (volatile missing).

Magnus Hagander

18 years agoPlease find attached two patches for documentation and regression tests
Bruce Momjian [Thu, 6 Jul 2006 01:46:38 +0000 (01:46 +0000)]
Please find attached two patches for documentation and regression tests
for the usage of full time zone names.

Joachim Wieland

18 years agoFixed remaining Coverity bugs.
Michael Meskes [Wed, 5 Jul 2006 10:49:56 +0000 (10:49 +0000)]
Fixed remaining Coverity bugs.

18 years agoDocumentation fixes for FILLFACTOR patch. Minor other editorialization.
Tom Lane [Tue, 4 Jul 2006 18:07:24 +0000 (18:07 +0000)]
Documentation fixes for FILLFACTOR patch.  Minor other editorialization.

18 years agoModify:
Bruce Momjian [Tue, 4 Jul 2006 13:22:41 +0000 (13:22 +0000)]
Modify:

<  o -Add PQescapeIdentifier()
>  o Add PQescapeIdentifierConn()

18 years agoRemove libpq's PQescapeIdentifier(), not safe from injection attacks.
Bruce Momjian [Tue, 4 Jul 2006 13:22:15 +0000 (13:22 +0000)]
Remove libpq's PQescapeIdentifier(), not safe from injection attacks.

18 years agoFix typos in comments.
Neil Conway [Tue, 4 Jul 2006 04:35:49 +0000 (04:35 +0000)]
Fix typos in comments.

18 years agoCode review for FILLFACTOR patch. Change WITH grammar as per earlier
Tom Lane [Mon, 3 Jul 2006 22:45:41 +0000 (22:45 +0000)]
Code review for FILLFACTOR patch.  Change WITH grammar as per earlier
discussion (including making def_arg allow reserved words), add missed
opt_definition for UNIQUE case.  Put the reloptions support code in a less
random place (I chose to make a new file access/common/reloptions.c).
Eliminate header inclusion creep.  Make the index options functions safely
user-callable (seems like client apps might like to be able to test validity
of options before trying to make an index).  Reduce overhead for normal case
with no options by allowing rd_options to be NULL.  Fix some unmaintainably
klugy code, including getting rid of Natts_pg_class_fixed at long last.
Some stylistic cleanup too, and pay attention to keeping comments in sync
with code.

Documentation still needs work, though I did fix the omissions in
catalogs.sgml and indexam.sgml.

18 years agoFix broken markup.
Tom Lane [Mon, 3 Jul 2006 16:43:14 +0000 (16:43 +0000)]
Fix broken markup.

18 years agoDo a pass of code review for the ALTER TABLE ADD INHERITS patch. Keep
Neil Conway [Sun, 2 Jul 2006 05:17:26 +0000 (05:17 +0000)]
Do a pass of code review for the ALTER TABLE ADD INHERITS patch. Keep
the read lock we hold on the table's parent relation until commit.
Update equalfuncs.c for the new field in AlterTableCmd. Various
improvements to comments, variable names, and error reporting.

There is room for further improvement here, but this is at least
a step in the right direction.

18 years agoAdd FILLFACTOR to CREATE INDEX.
Bruce Momjian [Sun, 2 Jul 2006 02:23:23 +0000 (02:23 +0000)]
Add FILLFACTOR to CREATE INDEX.

ITAGAKI Takahiro

18 years agoDone:
Bruce Momjian [Sun, 2 Jul 2006 02:22:39 +0000 (02:22 +0000)]
Done:

> * -Add fillfactor to control reserved free space during index creation

18 years agoDone:
Bruce Momjian [Sun, 2 Jul 2006 01:59:46 +0000 (01:59 +0000)]
Done:

<  o Add ALTER TABLE tab ADD/DROP INHERITS parent
<
<    This allows tables to be added/removed from an inheritance
<    hierarchy.  This is particularly useful for table partitioning.
<    http://archives.postgresql.org/pgsql-hackers/2006-05/msg00988.php
<
>  o -Add ALTER TABLE tab INHERIT / NO INHERIT  parent

18 years agoALTER TABLE ... ADD/DROPS INHERIT (actually INHERIT / NO INHERIT)
Bruce Momjian [Sun, 2 Jul 2006 01:58:36 +0000 (01:58 +0000)]
ALTER TABLE ... ADD/DROPS INHERIT (actually INHERIT / NO INHERIT)

Open items:

There were a few tangentially related issues that have come up that I think
are TODOs. I'm likely to tackle one or two of these next so I'm interested in
hearing feedback on them as well.

. Constraints currently do not know anything about inheritance. Tom suggested
  adding a coninhcount and conislocal like attributes have to track their
  inheritance status.

. Foreign key constraints currently do not get copied to new children (and
  therefore my code doesn't verify them). I don't think it would be hard to
  add them and treat them like CHECK constraints.

. No constraints at all are copied to tables defined with LIKE. That makes it
  hard to use LIKE to define new partitions. The standard defines LIKE and
  specifically says it does not copy constraints. But the standard already has
  an option called INCLUDING DEFAULTS; we could always define a non-standard
  extension LIKE table INCLUDING CONSTRAINTS that gives the user the option to
  request a copy including constraints.

. Personally, I think the whole attislocal thing is bunk. The decision about
  whether to drop a column from children tables or not is something that
  should be up to the user and trying to DWIM based on whether there was ever
  a local definition or the column was acquired purely through inheritance is
  hardly ever going to match up with user expectations.

. And of course there's the whole unique and primary key constraint issue. I
  think to get any traction at all on this you have a prerequisite of a real
  partitioned table implementation where the system knows what the partition
  key is so it can recognize when it's a leading part of an index key.

Greg Stark

18 years agoFix oversight in planning for multiple indexscans driven by
Tom Lane [Sat, 1 Jul 2006 22:07:23 +0000 (22:07 +0000)]
Fix oversight in planning for multiple indexscans driven by
ScalarArrayOpExpr index quals: we were estimating the right total
number of rows returned, but treating the index-access part of the
cost as if a single scan were fetching that many consecutive index
tuples.  Actually we should treat it as a multiple indexscan, and
if there are enough of 'em the Mackert-Lohman discount should kick in.

18 years agoRevise the planner's handling of "pseudoconstant" WHERE clauses, that is
Tom Lane [Sat, 1 Jul 2006 18:38:33 +0000 (18:38 +0000)]
Revise the planner's handling of "pseudoconstant" WHERE clauses, that is
clauses containing no variables and no volatile functions.  Such a clause
can be used as a one-time qual in a gating Result plan node, to suppress
plan execution entirely when it is false.  Even when the clause is true,
putting it in a gating node wins by avoiding repeated evaluation of the
clause.  In previous PG releases, query_planner() would do this for
pseudoconstant clauses appearing at the top level of the jointree, but
there was no ability to generate a gating Result deeper in the plan tree.
To fix it, get rid of the special case in query_planner(), and instead
process pseudoconstant clauses through the normal RestrictInfo qual
distribution mechanism.  When a pseudoconstant clause is found attached to
a path node in create_plan(), pull it out and generate a gating Result at
that point.  This requires special-casing pseudoconstants in selectivity
estimation and cost_qual_eval, but on the whole it's pretty clean.
It probably even makes the planner a bit faster than before for the normal
case of no pseudoconstants, since removing pull_constant_clauses saves one
useless traversal of the qual tree.  Per gripe from Phil Frost.

18 years agoFix memory leak introduced in the prior commit, detected by Tom Lane.
Alvaro Herrera [Fri, 30 Jun 2006 16:55:35 +0000 (16:55 +0000)]
Fix memory leak introduced in the prior commit, detected by Tom Lane.

18 years agoFix use-after-free error reported by Neil Conway.
Alvaro Herrera [Fri, 30 Jun 2006 15:06:05 +0000 (15:06 +0000)]
Fix use-after-free error reported by Neil Conway.

18 years agoUpdate item for GUID:
Bruce Momjian [Fri, 30 Jun 2006 15:04:32 +0000 (15:04 +0000)]
Update item for GUID:

< * Add 128-bit Universally Unique Identifier (UUID)
> * Add Globally/Universally Unique Identifier (GUID/UUID)

18 years agoRemove the separate 'stats buffer' process, letting backend stats messages
Tom Lane [Thu, 29 Jun 2006 20:00:08 +0000 (20:00 +0000)]
Remove the separate 'stats buffer' process, letting backend stats messages
be delivered directly to the collector process.  The extra process context
swaps required to transfer data through the buffer process seem to outweigh
any value the buffering might have.  Per recent discussion and tests.
I modified Bruce's draft patch to use poll() rather than select() where
available (this makes a noticeable difference on my system), and fixed
up the EXEC_BACKEND case.

18 years agoChange TRUNCATE's method for searching for foreign-key references so that
Tom Lane [Thu, 29 Jun 2006 16:07:29 +0000 (16:07 +0000)]
Change TRUNCATE's method for searching for foreign-key references so that
the order in which it visits tables is not dependent on the physical order
of pg_constraint entries, and neither are the error messages it gives.
This should correct recently-noticed instability in regression tests.

18 years agoChange URL for SITC:
Bruce Momjian [Thu, 29 Jun 2006 03:04:59 +0000 (03:04 +0000)]
Change URL for SITC:

<   http://momjian.us/cgi-bin/pgsitc
>   http://archives.postgresql.org/pgsql-hackers/2006-06/msg01534.php

18 years agoAdd:
Bruce Momjian [Thu, 29 Jun 2006 01:33:36 +0000 (01:33 +0000)]
Add:

> * Add 128-bit Universally Unique Identifier (UUID)

18 years agoAdd missing #include directive: pg_constraint.h declares some functions
Neil Conway [Wed, 28 Jun 2006 22:11:01 +0000 (22:11 +0000)]
Add missing #include directive: pg_constraint.h declares some functions
whose prototypes include the "List" type, so it ought to include the
list header file.

18 years agoFix typo in comment.
Neil Conway [Wed, 28 Jun 2006 22:05:37 +0000 (22:05 +0000)]
Fix typo in comment.

18 years agoEditorialization for the additions to the CREATE TABLE reference page
Neil Conway [Wed, 28 Jun 2006 22:01:52 +0000 (22:01 +0000)]
Editorialization for the additions to the CREATE TABLE reference page
made as part of the recent INCLUDING CONSTRAINTS patch. The text could
stand further improvement, but this is at least a step in the right
direction.

18 years agoAdd URL for SITC
Bruce Momjian [Wed, 28 Jun 2006 21:05:22 +0000 (21:05 +0000)]
Add URL for SITC

>   http://momjian.us/cgi-bin/pgsitc

18 years agoImprove planner estimates for size of tuple hash tables.
Tom Lane [Wed, 28 Jun 2006 20:04:38 +0000 (20:04 +0000)]
Improve planner estimates for size of tuple hash tables.

18 years agoFix hash aggregation to suppress unneeded columns from being stored in
Tom Lane [Wed, 28 Jun 2006 19:40:52 +0000 (19:40 +0000)]
Fix hash aggregation to suppress unneeded columns from being stored in
tuple hash table entries.  This addresses the problem previously noted
that use of a 'physical tlist' in the input scan node could bloat the
hash table entries far beyond what the planner expects.  It's a better
answer than my previous thought of undoing the physical tlist optimization,
because we can also remove columns that are needed to compute the aggregate
functions but aren't part of the grouping column set.

18 years agoAdjust TupleHashTables to use MinimalTuple format for contained tuples.
Tom Lane [Wed, 28 Jun 2006 17:05:49 +0000 (17:05 +0000)]
Adjust TupleHashTables to use MinimalTuple format for contained tuples.

18 years agoUpdate:
Bruce Momjian [Wed, 28 Jun 2006 15:39:32 +0000 (15:39 +0000)]
Update:

<  o Add support for WITH HOLD cursors
>  o Add support for WITH HOLD and SCROLL cursors
>
>    PL/pgSQL cursors should support the same syntax as
>    backend cursors.
>

18 years agoUpdate Russian FAQ.
Bruce Momjian [Wed, 28 Jun 2006 13:10:18 +0000 (13:10 +0000)]
Update Russian FAQ.

Viktor Vislobokov

18 years agoForget to add new file :((
Teodor Sigaev [Wed, 28 Jun 2006 12:08:35 +0000 (12:08 +0000)]
Forget to add new file :((

18 years agoChanges
Teodor Sigaev [Wed, 28 Jun 2006 12:00:14 +0000 (12:00 +0000)]
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

18 years agoRemove embedded newline in string literal --- seems to make newer gcc
Tom Lane [Tue, 27 Jun 2006 23:25:28 +0000 (23:25 +0000)]
Remove embedded newline in string literal --- seems to make newer gcc
versions very unhappy, and shouldn't be there anyway.

18 years agoAdd GUC update_process_title to control whether 'ps' display is updated
Bruce Momjian [Tue, 27 Jun 2006 22:16:44 +0000 (22:16 +0000)]
Add GUC update_process_title to control whether 'ps' display is updated
for every command, default to on.

18 years agoConvert hash join code to use MinimalTuple format in tuple hash table
Tom Lane [Tue, 27 Jun 2006 21:31:20 +0000 (21:31 +0000)]
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.

18 years agoDefault stats_command_string to 'on', now that its overhead is minimal.
Bruce Momjian [Tue, 27 Jun 2006 19:07:50 +0000 (19:07 +0000)]
Default stats_command_string to 'on', now that its overhead is minimal.

18 years agoPut #ifdef NOT_USED around posix_fadvise call. We may want to resurrect
Tom Lane [Tue, 27 Jun 2006 18:59:17 +0000 (18:59 +0000)]
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.

18 years agoRevert patch, doesn't do what it should:
Bruce Momjian [Tue, 27 Jun 2006 18:35:05 +0000 (18:35 +0000)]
Revert patch, doesn't do what it should:

* %Disallow changing default expression of a SERIAL column

Dhanaraj M

18 years agoExtend the MinimalTuple concept to tuplesort.c, thereby reducing the
Tom Lane [Tue, 27 Jun 2006 16:53:02 +0000 (16:53 +0000)]
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.

18 years agoWill revert in next patch more cleanly.
Bruce Momjian [Tue, 27 Jun 2006 16:42:00 +0000 (16:42 +0000)]
Will revert in next patch more cleanly.

> * -Disallow changing DEFAULT expression of a SERIAL column

18 years agoNot done:
Bruce Momjian [Tue, 27 Jun 2006 16:39:27 +0000 (16:39 +0000)]
Not done:

< * -Disallow changing DEFAULT expression of a SERIAL column
> * %Disallow changing DEFAULT expression of a SERIAL column

18 years agoClamp last_anl_tuples to n_live_tuples, in case we vacuum a table without
Alvaro Herrera [Tue, 27 Jun 2006 03:45:16 +0000 (03:45 +0000)]
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.

18 years agoAdd INCLUDING CONSTRAINTS to CREATE TABLE LIKE.
Bruce Momjian [Tue, 27 Jun 2006 03:43:20 +0000 (03:43 +0000)]
Add INCLUDING CONSTRAINTS to CREATE TABLE LIKE.

Greg Stark

18 years agoDone:
Bruce Momjian [Tue, 27 Jun 2006 03:22:45 +0000 (03:22 +0000)]
Done:

< * %Disallow changing DEFAULT expression of a SERIAL column?
<
<   This should be done only if the existing SERIAL problems cannot be
<   fixed.
<
> * -Disallow changing DEFAULT expression of a SERIAL column

18 years agoDisallow changing/dropping default expression of a SERIAL column
Bruce Momjian [Tue, 27 Jun 2006 03:21:55 +0000 (03:21 +0000)]
Disallow changing/dropping default expression of a SERIAL column

Dhanaraj M

18 years agoFix for recent Win32 pg_dump tar temp file patch.
Bruce Momjian [Tue, 27 Jun 2006 02:56:41 +0000 (02:56 +0000)]
Fix for recent Win32 pg_dump tar temp file patch.

Hiroshi Saito

18 years agoCreate infrastructure for 'MinimalTuple' representation of in-memory
Tom Lane [Tue, 27 Jun 2006 02:51:40 +0000 (02:51 +0000)]
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.

18 years agoOn Win32, use loop to create pg_dump temporary tar file in the current
Bruce Momjian [Tue, 27 Jun 2006 01:16:58 +0000 (01:16 +0000)]
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.

18 years agoDone:
Bruce Momjian [Tue, 27 Jun 2006 00:03:44 +0000 (00:03 +0000)]
Done:

>  o -Add PQescapeIdentifier()

18 years agoAdd PQescapeIdentifier() to libpq
Bruce Momjian [Tue, 27 Jun 2006 00:03:42 +0000 (00:03 +0000)]
Add PQescapeIdentifier() to libpq

Christopher Kings-Lynne

18 years agoFix blank line.
Bruce Momjian [Mon, 26 Jun 2006 23:53:14 +0000 (23:53 +0000)]
Fix blank line.

18 years agoAdd comment about the use of pg_config_paths.h.
Bruce Momjian [Mon, 26 Jun 2006 18:40:50 +0000 (18:40 +0000)]
Add comment about the use of pg_config_paths.h.

18 years agoChange the row constructor syntax (ROW(...)) so that list elements foo.*
Tom Lane [Mon, 26 Jun 2006 17:24:41 +0000 (17:24 +0000)]
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.

18 years agoAdded missing braces to prevent a segfault after usage of an undeclared cursor.
Michael Meskes [Mon, 26 Jun 2006 14:12:02 +0000 (14:12 +0000)]
Added missing braces to prevent a segfault after usage of an undeclared cursor.

18 years agoUse Unix newlines, instead of DOS ones.
Bruce Momjian [Mon, 26 Jun 2006 13:04:05 +0000 (13:04 +0000)]
Use Unix newlines, instead of DOS ones.

18 years agoUse Unix line endings instead of DOS ones, per Magnus.
Bruce Momjian [Mon, 26 Jun 2006 12:59:44 +0000 (12:59 +0000)]
Use Unix line endings instead of DOS ones, per Magnus.

18 years agoUpdate include files to Unix newline format, per report from Magnus.
Bruce Momjian [Mon, 26 Jun 2006 12:52:12 +0000 (12:52 +0000)]
Update include files to Unix newline format, per report from Magnus.

18 years agoUpdate comment description of geo routines and move comment to more
Bruce Momjian [Mon, 26 Jun 2006 12:32:42 +0000 (12:32 +0000)]
Update comment description of geo routines and move comment to more
relevant location.

18 years agoAdded some more coverity report patches send in by Joachim Wieland <joe@mcknight...
Michael Meskes [Mon, 26 Jun 2006 09:20:09 +0000 (09:20 +0000)]
Added some more coverity report patches send in by Joachim Wieland <joe@mcknight.de>.

18 years agoUpdate my info:
Bruce Momjian [Sun, 25 Jun 2006 18:52:03 +0000 (18:52 +0000)]
Update my info:

> * Bruce is Bruce Momjian <bruce@momjian.us> of EnterpriseDB

18 years agoTweak dynahash.c to avoid wasting memory space in non-shared hash tables.
Tom Lane [Sun, 25 Jun 2006 18:29:49 +0000 (18:29 +0000)]
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.

18 years agoAdd:
Bruce Momjian [Sun, 25 Jun 2006 16:27:41 +0000 (16:27 +0000)]
Add:

< * Reuse index tuples that point to rows that are not visible to anyone?
> * Reuse index tuples that point to heap tuples that are not visible to
>   anyone?

18 years agoMoved some free() calls that coverity correctly complains about.
Michael Meskes [Sun, 25 Jun 2006 09:38:40 +0000 (09:38 +0000)]
Moved some free() calls that coverity correctly complains about.

18 years agoOur version of getopt_long does not set optarg upon detecting an error, as
Alvaro Herrera [Sun, 25 Jun 2006 04:37:55 +0000 (04:37 +0000)]
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.

18 years agoRemove individual user copyright because the code is contributed to
Bruce Momjian [Sun, 25 Jun 2006 01:45:32 +0000 (01:45 +0000)]
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.

18 years agoFix GEVHDRSZ for Win32.
Bruce Momjian [Sun, 25 Jun 2006 01:02:12 +0000 (01:02 +0000)]
Fix GEVHDRSZ for Win32.

Magnus Hagander

18 years agoFix Win32/Cygwin problems:
Bruce Momjian [Sun, 25 Jun 2006 00:18:24 +0000 (00:18 +0000)]
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

18 years agoUpdate entry:
Bruce Momjian [Sat, 24 Jun 2006 23:47:58 +0000 (23:47 +0000)]
Update entry:

< * Allow heap reuse of UPDATEd rows if old and new versions are on the
<   same heap page?
> * Allow heap reuse of UPDATEd rows if no indexed columns are changed,
>   and old and new versions are on the same heap page?
<   This is possible for same-page updates because a single index row
<   can point to both old and new values.
>   While vacuum handles DELETEs fine, updating of non-indexed columns, like
>   counters, are difficult for VACUUM to handle efficiently.  This method
>   is possible for same-page updates because a single index row can be
>   used to point to both old and new values.

18 years agoAdd UPDATE entry for row reuse.
Bruce Momjian [Sat, 24 Jun 2006 23:45:02 +0000 (23:45 +0000)]
Add UPDATE entry for row reuse.

>
> * Allow heap reuse of UPDATEd rows if old and new versions are on the
>   same heap page?
>
>   This is possible for same-page updates because a single index row
>   can point to both old and new values.
>   http://archives.postgresql.org/pgsql-hackers/2006-06/msg01305.php

18 years agoFix re-inclusion of port header file on Windows, per Magnus.
Tom Lane [Sat, 24 Jun 2006 14:52:48 +0000 (14:52 +0000)]
Fix re-inclusion of port header file on Windows, per Magnus.

18 years agoClarified copyright notice
Michael Meskes [Fri, 23 Jun 2006 14:50:01 +0000 (14:50 +0000)]
Clarified copyright notice

18 years agoRemove dllinit.c; it was only needed for long-obsolete Cygwin versions,
Tom Lane [Thu, 22 Jun 2006 23:50:35 +0000 (23:50 +0000)]
Remove dllinit.c; it was only needed for long-obsolete Cygwin versions,
and there was some question about its copyright status.

18 years agopg_stop_backup was calling XLogArchiveNotify() twice for the newly created
Tom Lane [Thu, 22 Jun 2006 20:42:57 +0000 (20:42 +0000)]
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.

18 years agoStandalone backends need pgstat_bestart() too, per Qingqing Zhou.
Tom Lane [Thu, 22 Jun 2006 14:36:12 +0000 (14:36 +0000)]
Standalone backends need pgstat_bestart() too, per Qingqing Zhou.

18 years agoMove setup_cancel_handler() up near start of psql main(), where the
Tom Lane [Wed, 21 Jun 2006 19:40:31 +0000 (19:40 +0000)]
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.

18 years agoRemove ancient kluge that kept nodeAgg.c from crashing on UPDATEs involving
Tom Lane [Wed, 21 Jun 2006 18:39:42 +0000 (18:39 +0000)]
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.

18 years agoDisallow aggregate functions in UPDATE commands (unless within a sub-SELECT).
Tom Lane [Wed, 21 Jun 2006 18:30:11 +0000 (18:30 +0000)]
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.

18 years agoEliminate a gratuitously different wording of the 'cannot use aggregate function...
Tom Lane [Wed, 21 Jun 2006 18:09:53 +0000 (18:09 +0000)]
Eliminate a gratuitously different wording of the 'cannot use aggregate function in check constraint' error message.

18 years ago- During dblink_open, if transaction state was IDLE, force cursor count to
Joe Conway [Wed, 21 Jun 2006 16:43:11 +0000 (16:43 +0000)]
- During dblink_open, if transaction state was IDLE, force cursor count to
  initially be 0. This is needed as a previous ABORT might have wiped out
  an automatically opened transaction without maintaining the cursor count.
- Fix regression test expected file for the correct ERROR message, which
  we now get given the above bug fix.

18 years agoClean up psql variable code a little: eliminate unnecessary tests in
Tom Lane [Wed, 21 Jun 2006 16:05:11 +0000 (16:05 +0000)]
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 ...

18 years agoAdded some more coverity report patches send in by Martijn van Oosterhout <kleptog...
Michael Meskes [Wed, 21 Jun 2006 11:38:07 +0000 (11:38 +0000)]
Added some more coverity report patches send in by Martijn van Oosterhout <kleptog@svana.org>.

18 years agoFixed small typo in changelog
Michael Meskes [Wed, 21 Jun 2006 10:34:48 +0000 (10:34 +0000)]
Fixed small typo in changelog

18 years agoAdded fixed from the coverity report send in by Joachim Wieland <joe@mcknight.de>
Michael Meskes [Wed, 21 Jun 2006 10:24:41 +0000 (10:24 +0000)]
Added fixed from the coverity report send in by Joachim Wieland <joe@mcknight.de>
Added missing error handling in a few functions in ecpglib

18 years agoRemove redundant gettimeofday() calls to the extent practical without
Tom Lane [Tue, 20 Jun 2006 22:52:00 +0000 (22:52 +0000)]
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.

18 years agoSplit definitions for md5.c out of crypt.h and into their own header
Tom Lane [Tue, 20 Jun 2006 19:56:52 +0000 (19:56 +0000)]
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.

18 years agoSome editorial work on the documentation of the current-date/time
Tom Lane [Mon, 19 Jun 2006 16:13:01 +0000 (16:13 +0000)]
Some editorial work on the documentation of the current-date/time
functions.

18 years agoDo not use already free'ed errmsg, bug found by Joachim Wieland
Michael Meskes [Mon, 19 Jun 2006 09:19:49 +0000 (09:19 +0000)]
Do not use already free'ed errmsg, bug found by Joachim Wieland
<joachim.wieland@credativ.de>

18 years agoTake the statistics collector out of the loop for monitoring backends'
Tom Lane [Mon, 19 Jun 2006 01:51:22 +0000 (01:51 +0000)]
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.

18 years agoUpdate my email address.
Bruce Momjian [Sun, 18 Jun 2006 19:34:00 +0000 (19:34 +0000)]
Update my email address.

18 years agoDon't try to call posix_fadvise() unless <fcntl.h> supplies a declaration
Tom Lane [Sun, 18 Jun 2006 18:30:21 +0000 (18:30 +0000)]
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.

18 years agoFix saveHistory() to not emit bogus complaint during psql exit when using
Tom Lane [Sun, 18 Jun 2006 17:30:48 +0000 (17:30 +0000)]
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.

18 years agoIncrease timeout in statement_timeout test from 1 second to 2 seconds.
Tom Lane [Sun, 18 Jun 2006 16:21:23 +0000 (16:21 +0000)]
Increase timeout in statement_timeout test from 1 second to 2 seconds.
We have once or twice seen failures suggesting that control didn't get
to the exception block before the timeout elapsed, which is unlikely
but not impossible in a parallel regression test (with a dozen other
backends competing for cycles).  This change doesn't completely prevent
the problem of course, but it should reduce the probability enough that
we don't see it anymore.  Per buildfarm results.

18 years agoMerge postmaster and postgres command into just postgres. postmaster
Peter Eisentraut [Sun, 18 Jun 2006 15:38:37 +0000 (15:38 +0000)]
Merge postmaster and postgres command into just postgres.  postmaster
symlink is kept for now for compatibility.  To call single-user mode, use
postgres --single.