OSDN Git Service

pg-rex/syncrep.git
16 years agoOne-letter backslash commands now need a space before the first argument.
Peter Eisentraut [Fri, 2 May 2008 09:27:51 +0000 (09:27 +0000)]
One-letter backslash commands now need a space before the first argument.
This has been the only documented and encouraged syntax for a long time, and
with extension facilities such as aliases being proposed, it is a good time to
clean up the legacy syntax a bit.

Author: Bernd Helmle <mailings@oopsware.de>

16 years agoSigh ... pg_config.h.win32 needs to define BLCKSZ and RELSEG_SIZE now.
Tom Lane [Fri, 2 May 2008 03:41:46 +0000 (03:41 +0000)]
Sigh ... pg_config.h.win32 needs to define BLCKSZ and RELSEG_SIZE now.

16 years agoRemove the recently added USE_SEGMENTED_FILES option, and indeed remove all
Tom Lane [Fri, 2 May 2008 01:08:27 +0000 (01:08 +0000)]
Remove the recently added USE_SEGMENTED_FILES option, and indeed remove all
support for a nonsegmented mode from md.c.  Per recent discussions, there
doesn't seem to be much value in a "never segment" option as opposed to
segmenting with a suitably large segment size.  So instead provide a
configure-time switch to set the desired segment size in units of gigabytes.
While at it, expose a configure switch for BLCKSZ as well.

Zdenek Kotala

16 years agoAdd SGT (Singapore time) to the default list of known timezone
Tom Lane [Thu, 1 May 2008 20:05:08 +0000 (20:05 +0000)]
Add SGT (Singapore time) to the default list of known timezone
abbreviations.  It doesn't conflict with any other abbreviation
so there seems no reason not to include it.  Per a recent gripe.

16 years agoMake the minimum allowed value of work_mem be 64KB always, rather than having
Tom Lane [Thu, 1 May 2008 19:55:40 +0000 (19:55 +0000)]
Make the minimum allowed value of work_mem be 64KB always, rather than having
it vary with BLCKSZ as before.  This agrees with what the documentation says,
and avoids a regression test problem when BLCKSZ is larger than default.
Per recent discussion.

16 years agoFix nodeTidscan.c to not trigger an error if the block number portion of
Tom Lane [Wed, 30 Apr 2008 23:28:32 +0000 (23:28 +0000)]
Fix nodeTidscan.c to not trigger an error if the block number portion of
a user-supplied TID is out of range for the relation.  This is needed to
preserve compatibility with our pre-8.3 behavior, and it is sensible anyway
since if the query were implemented by brute force rather than optimized
into a TidScan, the behavior for a non-existent TID would be zero rows out,
never an error.  Per gripe from Gurjeet Singh.

16 years agoAdd example showing how to remove a password from a role.
Alvaro Herrera [Wed, 30 Apr 2008 12:38:49 +0000 (12:38 +0000)]
Add example showing how to remove a password from a role.

Andreas Scherbaum

16 years agoSome minor further cleanup around A_Const. Don't attach a typecast in
Tom Lane [Tue, 29 Apr 2008 20:44:49 +0000 (20:44 +0000)]
Some minor further cleanup around A_Const.  Don't attach a typecast in
makeFloatConst, and avoid "manual" construction of A_Const nodes in grammar
productions, in favor of using makeXXXConst subroutines.

16 years agoFix REASSIGN OWNED so that it works on procedural languages too.
Alvaro Herrera [Tue, 29 Apr 2008 19:37:04 +0000 (19:37 +0000)]
Fix REASSIGN OWNED so that it works on procedural languages too.

The capability for changing language owners is new in 8.3, so that's how
far back this needs to be backpatched.

Per bug #4132 by Kirill Simonov.

16 years agoRemove typename from A_Const.
Alvaro Herrera [Tue, 29 Apr 2008 14:59:17 +0000 (14:59 +0000)]
Remove typename from A_Const.

Brendan Jurd, minor editorialization by me.

16 years agoFix volatility marking for the generate_series and generate_subscripts families
Alvaro Herrera [Tue, 29 Apr 2008 13:00:22 +0000 (13:00 +0000)]
Fix volatility marking for the generate_series and generate_subscripts families
of functions.

16 years agoIncrease the statement_timeout value used in the prepared_xacts regression
Tom Lane [Mon, 28 Apr 2008 23:48:16 +0000 (23:48 +0000)]
Increase the statement_timeout value used in the prepared_xacts regression
test.  We have seen some buildfarm failures that seem to be due to this
limit being unexpectedly exceeded when the machine is under load.

16 years agoUpdate comment for 8.4:
Bruce Momjian [Mon, 28 Apr 2008 23:08:33 +0000 (23:08 +0000)]
Update comment for 8.4:

> #A hyphen, "-", marks changes that will appear in the upcoming 8.4 release.#

16 years agoFix broken configure test for libxslt: it was probing for xsltLibxmlVersion,
Tom Lane [Mon, 28 Apr 2008 22:47:03 +0000 (22:47 +0000)]
Fix broken configure test for libxslt: it was probing for xsltLibxmlVersion,
which is a global variable not a function, and so the probe failed on machines
where the linker makes a distinction (cf. Red Hat bug #444317).  Probe for
an actual function instead.

16 years agoBump the catversion for the previous patch.
Alvaro Herrera [Mon, 28 Apr 2008 14:57:35 +0000 (14:57 +0000)]
Bump the catversion for the previous patch.

16 years agoAdd generate_subscripts, a series-generation function which generates an
Alvaro Herrera [Mon, 28 Apr 2008 14:48:58 +0000 (14:48 +0000)]
Add generate_subscripts, a series-generation function which generates an
array's subscripts.

Pavel Stehule, some editorialization by me.

16 years agoAdd SGML ID attributes to the arrays subsections, and a few index entries for
Alvaro Herrera [Sun, 27 Apr 2008 04:33:27 +0000 (04:33 +0000)]
Add SGML ID attributes to the arrays subsections, and a few index entries for
them.

16 years agoCode review for recent patch to terminate online backup during shutdown:
Tom Lane [Sat, 26 Apr 2008 22:47:40 +0000 (22:47 +0000)]
Code review for recent patch to terminate online backup during shutdown:
do CancelBackup at a sane place, fix some oversights in the state transitions,
allow only superusers to connect while we are waiting for backup mode to end.

16 years agoAdd URL for:
Bruce Momjian [Fri, 25 Apr 2008 21:38:46 +0000 (21:38 +0000)]
Add URL for:

* Allow adding/renaming/removing enumerated values to an existing
  enumerated data type
>
>   http://archives.postgresql.org/pgsql-hackers/2008-04/msg01718.php
>

16 years agoUpdate wording from David Fetter.
Bruce Momjian [Fri, 25 Apr 2008 14:34:26 +0000 (14:34 +0000)]
Update wording from David Fetter.

16 years agoUpdate to remove passive wording from FAQ, David Fetter
Bruce Momjian [Fri, 25 Apr 2008 14:28:51 +0000 (14:28 +0000)]
Update to remove passive wording from FAQ, David Fetter

16 years agoUpdate TODO item:
Bruce Momjian [Thu, 24 Apr 2008 20:57:34 +0000 (20:57 +0000)]
Update TODO item:

> * Allow adding/renaming/removing enumerated values to an existing
>   enumerated data type

16 years agoRemove transformAlterTableStmt's kluge to replace ColumnDef.is_not_null
Tom Lane [Thu, 24 Apr 2008 20:46:49 +0000 (20:46 +0000)]
Remove transformAlterTableStmt's kluge to replace ColumnDef.is_not_null
flags by separate AT_SetNotNull subcommands.  That was always ugly and
inefficient, and it's now clear that it was merely a partial workaround
for the bug just identified in ATExecAddColumn.  This is just code
beautification not a bug fix, so no back-patch.

Brendan Jurd, with some trivial additional cleanup by me.

16 years agoUpdate:
Bruce Momjian [Thu, 24 Apr 2008 20:29:16 +0000 (20:29 +0000)]
Update:

< * Allow adding enumerated values to an existing enumerated data
> * Allow adding/removing enumerated values to an existing enumerated data

16 years agoFix ALTER TABLE ADD COLUMN ... PRIMARY KEY so that the new column is correctly
Tom Lane [Thu, 24 Apr 2008 20:17:50 +0000 (20:17 +0000)]
Fix ALTER TABLE ADD COLUMN ... PRIMARY KEY so that the new column is correctly
checked to see if it's been initialized to all non-nulls.  The implicit NOT
NULL constraint was not being checked during the ALTER (in fact, not even if
there was an explicit NOT NULL too), because ATExecAddColumn neglected to
set the flag needed to make the test happen.  This has been broken since
the capability was first added, in 8.0.

Brendan Jurd, per a report from Kaloyan Iliev.

16 years agoAdd embedded usage mention to FAQ, per Greg Smith.
Bruce Momjian [Thu, 24 Apr 2008 19:58:32 +0000 (19:58 +0000)]
Add embedded usage mention to FAQ, per Greg Smith.

16 years agoAdd to TODO:
Bruce Momjian [Thu, 24 Apr 2008 18:23:05 +0000 (18:23 +0000)]
Add to TODO:

> * Allow prepared transactions with temporary tables created and dropped
>   in the same transaction, and when an ON COMMIT DELETE ROWS temporary
>   table is accessed
>
>   http://archives.postgresql.org/pgsql-hackers/2008-03/msg00047.php

16 years agoAdd TODO item:
Bruce Momjian [Thu, 24 Apr 2008 17:32:44 +0000 (17:32 +0000)]
Add TODO item:

>
>  o Impove COPY performance
>
>    http://archives.postgresql.org/pgsql-hackers/2008-02/msg00954.php

16 years agoAdd URL for:
Bruce Momjian [Thu, 24 Apr 2008 17:06:13 +0000 (17:06 +0000)]
Add URL for:

* Allow index scans to return matching index keys, not just the matching
  heap locations
>
>   http://archives.postgresql.org/pgsql-hackers/2008-04/msg01657.php
>

16 years agoAdd to TODO:
Bruce Momjian [Thu, 24 Apr 2008 16:42:39 +0000 (16:42 +0000)]
Add to TODO:

> * Allow index scans to return matching index keys, not just the matching
>   heap locations

16 years agoAdd to TODO:
Bruce Momjian [Thu, 24 Apr 2008 16:14:25 +0000 (16:14 +0000)]
Add to TODO:

<
> * Allow adding enumerated values to an existing enumerated data
>   type

16 years agoRemove, item done, description unclear:
Bruce Momjian [Thu, 24 Apr 2008 16:11:31 +0000 (16:11 +0000)]
Remove, item done, description unclear:

< * Allow index scans to return matching index keys
<
<   http://archives.postgresql.org/pgsql-hackers/2007-03/msg01079.php

16 years agoUpdate TODO description for GIT:
Bruce Momjian [Thu, 24 Apr 2008 15:54:00 +0000 (15:54 +0000)]
Update TODO description for GIT:

* Consider smaller indexes that record a range of values per heap page,
  rather than having one index entry for every heap row

16 years agoUpdate error messages, per notes from Tom.
Magnus Hagander [Thu, 24 Apr 2008 14:23:43 +0000 (14:23 +0000)]
Update error messages, per notes from Tom.

Laurenz Albe

16 years agoAdd GIT URL:
Bruce Momjian [Thu, 24 Apr 2008 02:24:29 +0000 (02:24 +0000)]
Add GIT URL:

>   http://archives.postgresql.org/pgsql-hackers/2008-04/msg01589.php

16 years agoAdd to TODO:
Bruce Momjian [Thu, 24 Apr 2008 00:39:50 +0000 (00:39 +0000)]
Add to TODO:

<
>  o Add prompt escape to display the client and server versions

16 years agoAdd URL for MERGE:
Bruce Momjian [Wed, 23 Apr 2008 22:38:47 +0000 (22:38 +0000)]
Add URL for MERGE:

>   http://archives.postgresql.org/pgsql-hackers/2008-04/msg01475.php

16 years agoPrevent shutdown in normal mode if online backup is running, and
Magnus Hagander [Wed, 23 Apr 2008 13:44:59 +0000 (13:44 +0000)]
Prevent shutdown in normal mode if online backup is running, and
have pg_ctl warn about this.

Cancel running online backups (by renaming the backup_label file,
thus rendering the backup useless) when shutting down in fast mode.

Laurenz Albe

16 years agoFix using too many LWLocks bug, reported by Craig Ringer
Teodor Sigaev [Tue, 22 Apr 2008 17:52:43 +0000 (17:52 +0000)]
Fix using too many LWLocks bug, reported by Craig Ringer
<craig@postnewspapers.com.au>.
It was my mistake, I missed limitation of number of held locks, now GIN doesn't
use continiuous locks, but still hold buffers pinned to prevent interference
with vacuum's deletion algorithm.

Backpatch is needed.

16 years agoDon't pull in pthreads header files in this file because we never use them.
Magnus Hagander [Tue, 22 Apr 2008 13:06:57 +0000 (13:06 +0000)]
Don't pull in pthreads header files in this file because we never use them.

16 years agoFAQ2txt now only controls the main FAQ, not FAQ_DEV.
Bruce Momjian [Tue, 22 Apr 2008 10:30:32 +0000 (10:30 +0000)]
FAQ2txt now only controls the main FAQ, not FAQ_DEV.

16 years agoReplace developer FAQ with a reference to the wiki, which is where
Magnus Hagander [Tue, 22 Apr 2008 09:26:32 +0000 (09:26 +0000)]
Replace developer FAQ with a reference to the wiki, which is where
it now lives (per discussion). Leave the other FAQs alone for now.

16 years agoIssue explicit error messages for attempts to use "shell" operators in
Tom Lane [Tue, 22 Apr 2008 01:34:34 +0000 (01:34 +0000)]
Issue explicit error messages for attempts to use "shell" operators in
ordinary expressions.  This probably doesn't catch every single case
where you might get "cache lookup failed for function 0" for use of a
shell operator, but it will catch most.  Per bug #4120 from Pedro Gimeno.

This patch incidentally folds make_op_expr() into its sole remaining
caller --- the alternative was to give it yet more arguments, which
didn't seem an improvement.

16 years agoFix convert_IN_to_join to properly handle the case where the subselect's
Tom Lane [Mon, 21 Apr 2008 20:54:15 +0000 (20:54 +0000)]
Fix convert_IN_to_join to properly handle the case where the subselect's
output is not of the same type that's needed for the IN comparison (ie,
where the parser inserted an implicit coercion above the subselect result).
We should record the coerced expression, not just a raw Var referencing
the subselect output, as the quantity that needs to be unique-ified if
we choose to implement the IN as Unique followed by a plain join.

As of 8.3 this error was causing crashes, as seen in bug #4113 from Javier
Hernandez, because the executor was being told to hash or sort the raw
subselect output column using operators appropriate to the coerced type.

In prior versions there was no crash because the executor chose the
hash or sort operators for itself based on the column type it saw.
However, that's still not really right, because what's unique for one data
type might not be unique for another.  In corner cases we could get multiple
outputs of a row that should appear only once, as demonstrated by the
regression test case included in this commit.

However, this patch doesn't apply cleanly to 8.2 or before, and the code
involved has shifted enough over time that I'm hesitant to try to back-patch.
Given the lack of complaints from the field about such corner cases, I think
the bug may not be important enough to risk breaking other things with a
back-patch.

16 years agoClean up float4byval and float8byval handling by dealing with them completely
Magnus Hagander [Mon, 21 Apr 2008 18:37:28 +0000 (18:37 +0000)]
Clean up float4byval and float8byval handling by dealing with them completely
from inside the build script.

16 years agoFix typo, noted by Stefan Kaltenbrunner.
Magnus Hagander [Mon, 21 Apr 2008 11:06:13 +0000 (11:06 +0000)]
Fix typo, noted by Stefan Kaltenbrunner.

16 years agoMake float4byval and float8byval configurable on MSVC.
Magnus Hagander [Mon, 21 Apr 2008 10:01:32 +0000 (10:01 +0000)]
Make float4byval and float8byval configurable on MSVC.

16 years agoAdd link to major version release notes at the top of the minor
Magnus Hagander [Mon, 21 Apr 2008 09:44:47 +0000 (09:44 +0000)]
Add link to major version release notes at the top of the minor
version ones, to make it clear to users just browsing the notes
that there are a lot more changes available from whatever version
they are at than what's in the minor version release notes.

16 years agoFix a couple of places in execMain that erroneously assumed that SELECT FOR
Tom Lane [Mon, 21 Apr 2008 03:49:45 +0000 (03:49 +0000)]
Fix a couple of places in execMain that erroneously assumed that SELECT FOR
UPDATE/SHARE couldn't occur as a subquery in a query with a non-SELECT
top-level operation.  Symptoms included outright failure (as in report from
Mark Mielke) and silently neglecting to take the requested row locks.

Back-patch to 8.3, because the visible failure in the INSERT ... SELECT case
is a regression from 8.2.  I'm a bit hesitant to back-patch further given the
lack of field complaints.

16 years agoAdd FLOAT4PASSBYVAL/FLOAT8PASSBYVAL to pg_config.h.win32, as a stopgap
Tom Lane [Mon, 21 Apr 2008 02:04:09 +0000 (02:04 +0000)]
Add FLOAT4PASSBYVAL/FLOAT8PASSBYVAL to pg_config.h.win32, as a stopgap
measure to get the Windows buildfarm members working again.  I don't
know if it's worth exposing these as configurables, or exactly how to
do it in the MSVC build system ...

16 years agoMake earthdistance use version-0 calling convention if not USE_FLOAT8_BYVAL,
Tom Lane [Mon, 21 Apr 2008 01:11:43 +0000 (01:11 +0000)]
Make earthdistance use version-0 calling convention if not USE_FLOAT8_BYVAL,
and version-1 if USE_FLOAT8_BYVAL.  This might seem a bit pointless, but the
idea is to have at least one regression test that will fail if we ever
accidentally break version-0 functions that return float8.  However, they're
already broken, or at least hopelessly unportable, in the USE_FLOAT8_BYVAL
case.

Per a recent suggestion from Greg Stark.

16 years agoAllow float8, int8, and related datatypes to be passed by value on machines
Tom Lane [Mon, 21 Apr 2008 00:26:47 +0000 (00:26 +0000)]
Allow float8, int8, and related datatypes to be passed by value on machines
where Datum is 8 bytes wide.  Since this will break old-style C functions
(those still using version 0 calling convention) that have arguments or
results of these types, provide a configure option to disable it and retain
the old pass-by-reference behavior.  Likewise, provide a configure option
to disable the recently-committed float4 pass-by-value change.

Zoltan Boszormenyi, plus configurability stuff by me.

16 years agoFix broken compare function for tsquery_ops. Per Tom's report.
Teodor Sigaev [Sun, 20 Apr 2008 09:17:57 +0000 (09:17 +0000)]
Fix broken compare function for tsquery_ops. Per Tom's report.

I never understood why initial authors GiST in pgsql choose so
stgrange signature for 'same' method:
bool *sameFn(Datum a, Datum b, bool* result)
instead of simple, logical
bool sameFn(Datum a, Datum b)
This change will break any existing GiST extension, so we still live with
it and will live.

16 years agoConvert earthdistance's only C function to v1 call convention,
Tom Lane [Sun, 20 Apr 2008 01:05:52 +0000 (01:05 +0000)]
Convert earthdistance's only C function to v1 call convention,
to future-proof it against pass-by-value float8.

16 years agoseg_size() has to be V1 calling convention, too.
Tom Lane [Sat, 19 Apr 2008 22:55:03 +0000 (22:55 +0000)]
seg_size() has to be V1 calling convention, too.

16 years agoUpdate doc script comments.
Bruce Momjian [Sat, 19 Apr 2008 12:52:51 +0000 (12:52 +0000)]
Update doc script comments.

16 years agoAdd script FAQ2txt to convert HTML files to txt. Add comment to TODO2html.
Bruce Momjian [Sat, 19 Apr 2008 12:42:35 +0000 (12:42 +0000)]
Add script FAQ2txt to convert HTML files to txt.  Add comment to TODO2html.

16 years agoAdd TODO2html tool to convert TODO to HTML.
Bruce Momjian [Sat, 19 Apr 2008 12:34:54 +0000 (12:34 +0000)]
Add TODO2html tool to convert TODO to HTML.

16 years agoUpdate TODO using new script.
Bruce Momjian [Sat, 19 Apr 2008 12:33:06 +0000 (12:33 +0000)]
Update TODO using new script.

16 years agoRemove TODO.detail directory. All URLs now in TODO file as references.
Bruce Momjian [Sat, 19 Apr 2008 12:19:41 +0000 (12:19 +0000)]
Remove TODO.detail directory.  All URLs now in TODO file as references.

16 years agoRemove TODO.detail references; instead add TODO URLs pointing to the
Bruce Momjian [Sat, 19 Apr 2008 12:16:21 +0000 (12:16 +0000)]
Remove TODO.detail references;  instead add TODO URLs pointing to the
archives.  We have been using URLs for a while for new items.

16 years agoChange the float4-returning functions in contrib/seg to fmgr v1 calling
Alvaro Herrera [Fri, 18 Apr 2008 21:11:35 +0000 (21:11 +0000)]
Change the float4-returning functions in contrib/seg to fmgr v1 calling
conventions.

I also changed seg_in and seg_out, which was probably unnecessary, but
it can't harm.

16 years agoFix typo.
Tom Lane [Fri, 18 Apr 2008 20:51:17 +0000 (20:51 +0000)]
Fix typo.

16 years agoModify the float4 datatype to be pass-by-val. Along the way, remove the last
Alvaro Herrera [Fri, 18 Apr 2008 18:43:09 +0000 (18:43 +0000)]
Modify the float4 datatype to be pass-by-val.  Along the way, remove the last
uses of the long-deprecated float32 in contrib/seg; the definitions themselves
are still there, but no longer used.  fmgr/README updated to match.

I added a CREATE FUNCTION to account for existing seg_center() code in seg.c
too, and some tests for it and the neighbor functions.  At the same time,
remove checks for NULL which are not needed (because the functions are declared
STRICT).

I had to do some adjustments to contrib's btree_gist too.  The choices for
representation there are not ideal for changing the underlying types :-(

Original patch by Zoltan Boszormenyi, with some adjustments by me.

16 years agoFix rmtree() so that it keeps going after failure to remove any individual
Tom Lane [Fri, 18 Apr 2008 17:05:45 +0000 (17:05 +0000)]
Fix rmtree() so that it keeps going after failure to remove any individual
file; the idea is that we should clean up as much as we can, even if there's
some problem removing one file.  Make the error messages a bit less misleading,
too.  In passing, const-ify function arguments.

16 years agoFix two race conditions between the pending unlink mechanism that was put in
Heikki Linnakangas [Fri, 18 Apr 2008 06:48:38 +0000 (06:48 +0000)]
Fix two race conditions between the pending unlink mechanism that was put in
place to prevent reusing relation OIDs before next checkpoint, and DROP
DATABASE. First, if a database was dropped, bgwriter would still try to unlink
the files that the rmtree() call by the DROP DATABASE command has already
deleted, or is just about to delete. Second, if a database is dropped, and
another database is created with the same OID, bgwriter would in the worst
case delete a relation in the new database that happened to get the same OID
as a dropped relation in the old database.

To fix these race conditions:
- make rmtree() ignore ENOENT errors. This fixes the 1st race condition.
- make ForgetDatabaseFsyncRequests forget unlink requests as well.
- force checkpoint on in dropdb on all platforms

Since ForgetDatabaseFsyncRequests() is asynchronous, the 2nd change isn't
enough on its own to fix the problem of dropping and creating a database with
same OID, but forcing a checkpoint on DROP DATABASE makes it sufficient.

Per Tom Lane's bug report and proposal. Backpatch to 8.3.

16 years agoCause EXPLAIN's VERBOSE option to print the target list (output column list)
Tom Lane [Fri, 18 Apr 2008 01:42:17 +0000 (01:42 +0000)]
Cause EXPLAIN's VERBOSE option to print the target list (output column list)
of each plan node, instead of its former behavior of dumping the internal
representation of the plan tree.  The latter display is still available for
those who really want it (see debug_print_plan), but uses for it are certainly
few and and far between.  Per discussion.

This patch also removes the explain_pretty_print GUC, which is obsoleted
by the change.

16 years agoClean up a few places where Datums were being treated as pointers (and vice
Alvaro Herrera [Thu, 17 Apr 2008 21:37:28 +0000 (21:37 +0000)]
Clean up a few places where Datums were being treated as pointers (and vice
versa) without going through DatumGetPointer.

Gavin Sherry, with Feng Tian.

16 years agoFix a couple of oversights associated with the "physical tlist" optimization:
Tom Lane [Thu, 17 Apr 2008 21:22:14 +0000 (21:22 +0000)]
Fix a couple of oversights associated with the "physical tlist" optimization:
we had several code paths where a physical tlist could be used for the input
to a Sort node, which is a dumb idea because any unneeded table columns will
increase the volume of data the sort has to push around.

(Unfortunately the easy-looking fix of calling disuse_physical_tlist during
make_sort_xxx doesn't work because in most cases we're already committed to
the current input tlist --- it's been marked with sort column numbers, or
we've built grouping column numbers using it, etc.  The tlist has to be
selected properly at the calling level before we start constructing sort-col
information.  This is easy enough to do, we were just failing to take the
point into consideration.)

Back-patch to 8.3.  I believe the problem probably exists clear back to 7.4
when the physical tlist optimization was added, but I'm afraid to back-patch
further than 8.3 without a great deal more study than I want to put into it.
The code in this area has drifted a lot over time.  The real-world importance
of these code paths is uncertain anyway --- I think in many cases we'd
probably prefer hash-based methods.

16 years agoTODO Done:
Bruce Momjian [Thu, 17 Apr 2008 20:57:07 +0000 (20:57 +0000)]
TODO Done:

> * -Allow administrators to safely terminate individual sessions

16 years agoRe-enable pg_terminate_backend() using SIGTERM. SIGTERM testing still
Bruce Momjian [Thu, 17 Apr 2008 20:56:41 +0000 (20:56 +0000)]
Re-enable pg_terminate_backend() using SIGTERM.  SIGTERM testing still
needed.

16 years agoAdd some code to EXPLAIN to show the targetlist (ie, output columns)
Tom Lane [Thu, 17 Apr 2008 18:30:18 +0000 (18:30 +0000)]
Add some code to EXPLAIN to show the targetlist (ie, output columns)
of each plan node.  For the moment this is debug support only and is
not enabled unless EXPLAIN_PRINT_TLISTS is defined at build time.
Later I'll see about the idea of letting EXPLAIN VERBOSE do it.

16 years agoRepair two places where SIGTERM exit could leave shared memory state
Tom Lane [Wed, 16 Apr 2008 23:59:40 +0000 (23:59 +0000)]
Repair two places where SIGTERM exit could leave shared memory state
corrupted.  (Neither is very important if SIGTERM is used to shut down the
whole database cluster together, but there's a problem if someone tries to
SIGTERM individual backends.)  To do this, introduce new infrastructure
macros PG_ENSURE_ERROR_CLEANUP/PG_END_ENSURE_ERROR_CLEANUP that take care
of transiently pushing an on_shmem_exit cleanup hook.  Also use this method
for createdb cleanup --- that wasn't a shared-memory-corruption problem,
but SIGTERM abort of createdb could leave orphaned files lying around.

Backpatch as far as 8.2.  The shmem corruption cases don't exist in 8.1,
and the createdb usage doesn't seem important enough to risk backpatching
further.

16 years agoFix MinGW warnings re formats and unused variables. per ITAGAKI Takahiro
Andrew Dunstan [Wed, 16 Apr 2008 22:16:00 +0000 (22:16 +0000)]
Fix MinGW warnings re formats and unused variables. per ITAGAKI Takahiro

16 years agoIgnore blank lines in typedef file.
Bruce Momjian [Wed, 16 Apr 2008 21:03:08 +0000 (21:03 +0000)]
Ignore blank lines in typedef file.

16 years agoUpdate most recent release to 8.3.1.
Bruce Momjian [Wed, 16 Apr 2008 20:57:18 +0000 (20:57 +0000)]
Update most recent release to 8.3.1.

16 years agoFix LOAD_CRIT_INDEX() macro to take out AccessShareLock on the system index
Tom Lane [Wed, 16 Apr 2008 18:23:04 +0000 (18:23 +0000)]
Fix LOAD_CRIT_INDEX() macro to take out AccessShareLock on the system index
it is trying to build a relcache entry for.  This is an oversight in my 8.2
patch that tried to ensure we always took a lock on a relation before trying
to build its relcache entry.  The implication is that if someone committed a
reindex of a critical system index at about the same time that some other
backend were starting up without a valid pg_internal.init file, the second one
might PANIC due to not seeing any valid version of the index's pg_class row.
Improbable case, but definitely not impossible.

16 years agoFix comment typo.
Bruce Momjian [Wed, 16 Apr 2008 18:18:00 +0000 (18:18 +0000)]
Fix comment typo.

Bryce Nesbitt

16 years agoUpdate TODO wording.
Bruce Momjian [Wed, 16 Apr 2008 17:50:01 +0000 (17:50 +0000)]
Update TODO wording.

16 years agoAdd to TODO:
Bruce Momjian [Wed, 16 Apr 2008 17:25:56 +0000 (17:25 +0000)]
Add to TODO:

> * Implement the non-threaded Avahi service discovery protocol
>   http://archives.postgresql.org/pgsql-hackers/2008-02/msg00939.php
>   http://archives.postgresql.org/pgsql-patches/2008-02/msg00097.php
>   http://archives.postgresql.org/pgsql-hackers/2008-03/msg01211.php
>   http://archives.postgresql.org/pgsql-patches/2008-04/msg00001.php

16 years agoAvoid using unnecessary pgwin32_safestat in libpq.
Andrew Dunstan [Wed, 16 Apr 2008 14:19:56 +0000 (14:19 +0000)]
Avoid using unnecessary pgwin32_safestat in libpq.

16 years agoRe-add terminate TODO item.
Bruce Momjian [Tue, 15 Apr 2008 21:39:19 +0000 (21:39 +0000)]
Re-add terminate TODO item.

16 years agoRevert addition of pg_terminate_backend() because of race conditions.
Bruce Momjian [Tue, 15 Apr 2008 20:28:47 +0000 (20:28 +0000)]
Revert addition of pg_terminate_backend() because of race conditions.

16 years agoAdd multi-line flag to regex that needs it. Backpatch to 8.2. Fix from Andreas Zeugsw...
Andrew Dunstan [Tue, 15 Apr 2008 16:22:36 +0000 (16:22 +0000)]
Add multi-line flag to regex that needs it. Backpatch to 8.2. Fix from Andreas Zeugswetter

16 years agoAdd TODO item:
Bruce Momjian [Tue, 15 Apr 2008 15:08:59 +0000 (15:08 +0000)]
Add TODO item:

< * Allow NOTIFY in rules involving conditionals
>
>  o Allow NOTIFY in rules involving conditionals
>  o Improve LISTEN concurrency
>
>    http://archives.postgresql.org/pgsql-hackers/2008-02/msg01106.php

16 years agoMove LISTEN/NOTIFY items to separate TODO section.
Bruce Momjian [Tue, 15 Apr 2008 15:07:09 +0000 (15:07 +0000)]
Move LISTEN/NOTIFY items to separate TODO section.

16 years agoAdd to TODO:
Bruce Momjian [Tue, 15 Apr 2008 14:24:32 +0000 (14:24 +0000)]
Add to TODO:

> * Allow XML to accept more liberal DOCTYPE specifications
>
>   http://archives.postgresql.org/pgsql-general/2008-02/msg00347.php

16 years agoDone:
Bruce Momjian [Tue, 15 Apr 2008 13:55:42 +0000 (13:55 +0000)]
Done:

> * -Allow administrators to safely terminate individual sessions either

16 years agoAdd pg_terminate_backend() to allow terminating only a single session.
Bruce Momjian [Tue, 15 Apr 2008 13:55:12 +0000 (13:55 +0000)]
Add pg_terminate_backend() to allow terminating only a single session.

16 years agoMake integer_datetimes the default for MSVC even if not mentioned in config.pl.
Andrew Dunstan [Tue, 15 Apr 2008 12:16:51 +0000 (12:16 +0000)]
Make integer_datetimes the default for MSVC even if not mentioned in config.pl.

16 years agoPush index operator lossiness determination down to GIST/GIN opclass
Tom Lane [Mon, 14 Apr 2008 17:05:34 +0000 (17:05 +0000)]
Push index operator lossiness determination down to GIST/GIN opclass
"consistent" functions, and remove pg_amop.opreqcheck, as per recent
discussion.  The main immediate benefit of this is that we no longer need
8.3's ugly hack of requiring @@@ rather than @@ to test weight-using tsquery
searches on GIN indexes.  In future it should be possible to optimize some
other queries better than is done now, by detecting at runtime whether the
index match is exact or not.

Tom Lane, after an idea of Heikki's, and with some help from Teodor.

16 years agoFix indentation in new REFERENCED BY psql output, per Brendan Jurd.
Alvaro Herrera [Mon, 14 Apr 2008 15:04:20 +0000 (15:04 +0000)]
Fix indentation in new REFERENCED BY psql output, per Brendan Jurd.

16 years agoAdd URL for:
Bruce Momjian [Mon, 14 Apr 2008 13:33:53 +0000 (13:33 +0000)]
Add URL for:

* Consider automatic caching of statements at various levels:

>  http://archives.postgresql.org/pgsql-hackers/2008-04/msg00823.php

16 years agoSince createplan.c no longer cares whether index operators are lossy, it has
Tom Lane [Sun, 13 Apr 2008 20:51:21 +0000 (20:51 +0000)]
Since createplan.c no longer cares whether index operators are lossy, it has
no particular need to do get_op_opfamily_properties() while building an
indexscan plan.  Postpone that lookup until executor start.  This simplifies
createplan.c a lot more than it complicates nodeIndexscan.c, and makes things
more uniform since we already had to do it that way for RowCompare
expressions.  Should be a bit faster too, at least for plans that aren't
re-used many times, since we avoid palloc'ing and perhaps copying the
intermediate list data structure.

16 years agoPhase 2 of project to make index operator lossiness be determined at runtime
Tom Lane [Sun, 13 Apr 2008 19:18:14 +0000 (19:18 +0000)]
Phase 2 of project to make index operator lossiness be determined at runtime
instead of plan time.  Extend the amgettuple API so that the index AM returns
a boolean indicating whether the indexquals need to be rechecked, and make
that rechecking happen in nodeIndexscan.c (currently the only place where
it's expected to be needed; other callers of index_getnext are just erroring
out for now).  For the moment, GIN and GIST have stub logic that just always
sets the recheck flag to TRUE --- I'm hoping to get Teodor to handle pushing
that control down to the opclass consistent() functions.  The planner no
longer pays any attention to amopreqcheck, and that catalog column will go
away in due course.

16 years agoTurn the -i/--ignore-version options of pg_dump and pg_dumpall into no-ops:
Tom Lane [Sun, 13 Apr 2008 03:49:22 +0000 (03:49 +0000)]
Turn the -i/--ignore-version options of pg_dump and pg_dumpall into no-ops:
the server version check is now always enforced.  Relax the version check to
allow a server that is of pg_dump's own major version but a later minor
version; this is the only case that -i was at all safe to use in.

pg_restore already enforced only a very weak version check, so this is
really just a documentation change for it.

Per discussion.

16 years agoClean up a few places where Datums were being treated as pointers without
Tom Lane [Sat, 12 Apr 2008 23:21:04 +0000 (23:21 +0000)]
Clean up a few places where Datums were being treated as pointers without
going through DatumGetPointer or some other "official" conversion macro.
Not actually a bug, since Datum the same size as pointer is the only
supported case at the moment, but good cleanup for the future.

Gavin Sherry

16 years agoCreate new routines systable_beginscan_ordered, systable_getnext_ordered,
Tom Lane [Sat, 12 Apr 2008 23:14:21 +0000 (23:14 +0000)]
Create new routines systable_beginscan_ordered, systable_getnext_ordered,
systable_endscan_ordered that have API similar to systable_beginscan etc
(in particular, the passed-in scankeys have heap not index attnums),
but guarantee ordered output, unlike the existing functions.  For the moment
these are just very thin wrappers around index_beginscan/index_getnext/etc.
Someday they might need to get smarter; but for now this is just a code
refactoring exercise to reduce the number of direct callers of index_getnext,
in preparation for changing that function's API.

In passing, remove index_getnext_indexitem, which has been dead code for
quite some time, and will have even less use than that in the presence
of run-time-lossy indexes.

16 years agoA quick try at un-breaking the Cygwin build. Whether it needs the
Tom Lane [Fri, 11 Apr 2008 23:53:00 +0000 (23:53 +0000)]
A quick try at un-breaking the Cygwin build.  Whether it needs the
pgwin32_safestat remains to be determined, but in any case the current
code is not tolerable.

16 years agoAdd some debug support code to try to catch future mistakes in the area of
Tom Lane [Fri, 11 Apr 2008 22:54:23 +0000 (22:54 +0000)]
Add some debug support code to try to catch future mistakes in the area of
input functions that include garbage bytes in their results.  Provide a
compile-time option RANDOMIZE_ALLOCATED_MEMORY to make palloc fill returned
blocks with variable contents.  This option also makes the parser perform
conversions of literal constants twice and compare the results, emitting a
WARNING if they don't match.  (This is the code I used to catch the input
function bugs fixed in the previous commit.)  For the moment, I've set it
to be activated automatically by --enable-cassert.