OSDN Git Service

pg-rex/syncrep.git
19 years agoUpdate FAQ release number to 8.0.2.
Bruce Momjian [Sat, 23 Apr 2005 15:22:56 +0000 (15:22 +0000)]
Update FAQ release number to 8.0.2.

19 years agoModify output of VACUUM VERBOSE to be clearer.
Bruce Momjian [Sat, 23 Apr 2005 15:20:39 +0000 (15:20 +0000)]
Modify output of VACUUM VERBOSE to be clearer.

19 years agoint_aggregate's int_enum() doesn't work correctly with arrays that
Tom Lane [Sat, 23 Apr 2005 05:38:22 +0000 (05:38 +0000)]
int_aggregate's int_enum() doesn't work correctly with arrays that
aren't 1-D, so give an error message instead of failing.  Per report
from Ron Mayer.

19 years agoTurns out that my recent elimination of the 'redundant' flatten_andors()
Tom Lane [Sat, 23 Apr 2005 04:42:53 +0000 (04:42 +0000)]
Turns out that my recent elimination of the 'redundant' flatten_andors()
code in prepqual.c had a small drawback: the flatten_andors code was
able to cope with deeply nested AND/OR structures (like 10000 ORs in
a row), whereas eval_const_expressions tends to recurse until it
overruns the stack.  Revise eval_const_expressions so that it doesn't
choke on deeply nested ANDs or ORs.

19 years agoAdd documentation stating how to determine if FSM settings are too low
Bruce Momjian [Sat, 23 Apr 2005 03:27:40 +0000 (03:27 +0000)]
Add documentation stating how to determine if FSM settings are too low
--- look at a database-wide VACUUM VERBOSE.

19 years agoTeach choose_bitmap_and() to actually be choosy --- that is, try to
Tom Lane [Sat, 23 Apr 2005 01:57:34 +0000 (01:57 +0000)]
Teach choose_bitmap_and() to actually be choosy --- that is, try to
make some estimate of which available indexes to AND together, rather
than blindly taking 'em all.  This could probably stand further
improvement, but it seems to do OK in simple tests.

19 years agoFix bogus EXPLAIN display of rowcount estimates for BitmapAnd and
Tom Lane [Sat, 23 Apr 2005 01:29:15 +0000 (01:29 +0000)]
Fix bogus EXPLAIN display of rowcount estimates for BitmapAnd and
BitmapOr nodes.

19 years agoFirst cut at planner support for bitmap index scans. Lots to do yet,
Tom Lane [Fri, 22 Apr 2005 21:58:32 +0000 (21:58 +0000)]
First cut at planner support for bitmap index scans.  Lots to do yet,
but the code is basically working.  Along the way, rewrite the entire
approach to processing OR index conditions, and make it work in join
cases for the first time ever.  orindxpath.c is now basically obsolete,
but I left it in for the time being to allow easy comparison testing
against the old implementation.

19 years agoFix typo:
Bruce Momjian [Fri, 22 Apr 2005 15:40:16 +0000 (15:40 +0000)]
Fix typo:

<   Currently indexes do not have enough tuple tuple visibility
<   information to allow data to be pulled from the index without
<   also accessing the heap.  One way to allow this is to set a bit
<   to index tuples to indicate if a tuple is currently visible to
<   all transactions when the first valid heap lookup happens.  This
<   bit would have to be cleared when a heap tuple is expired.
>   Currently indexes do not have enough tuple visibility information
>   to allow data to be pulled from the index without also accessing
>   the heap.  One way to allow this is to set a bit to index tuples
>   to indicate if a tuple is currently visible to all transactions
>   when the first valid heap lookup happens.  This bit would have to
>   be cleared when a heap tuple is expired.

19 years agoTypo fix. Alvaro.
Bruce Momjian [Fri, 22 Apr 2005 15:32:58 +0000 (15:32 +0000)]
Typo fix.  Alvaro.

19 years agoUpdate URL for TODO list.
Bruce Momjian [Fri, 22 Apr 2005 13:38:19 +0000 (13:38 +0000)]
Update URL for TODO list.

19 years agoRemove pre-7.3 mention that FOR UPDATE can be before LIMIT.
Bruce Momjian [Fri, 22 Apr 2005 04:20:44 +0000 (04:20 +0000)]
Remove pre-7.3 mention that FOR UPDATE can be before LIMIT.

Document that FOR UPDATE and LIMIT together can return fewer rows that
LIMIT specifies, and why.

19 years agoClarify that only crypt can't use md5 pg_shadow passwords.
Bruce Momjian [Fri, 22 Apr 2005 04:18:58 +0000 (04:18 +0000)]
Clarify that only crypt can't use md5 pg_shadow passwords.

19 years agoClarify use of MD5 authentication and pg_shadow encryption.
Bruce Momjian [Thu, 21 Apr 2005 22:19:19 +0000 (22:19 +0000)]
Clarify use of MD5 authentication and pg_shadow encryption.

19 years agoRethink original decision to use AND/OR Expr nodes to represent bitmap
Tom Lane [Thu, 21 Apr 2005 19:18:13 +0000 (19:18 +0000)]
Rethink original decision to use AND/OR Expr nodes to represent bitmap
logic operations during planning.  Seems cleaner to create two new Path
node types, instead --- this avoids duplication of cost-estimation code.
Also, create an enable_bitmapscan GUC parameter to control use of bitmap
plans.

19 years agoUpdated text for bitmaps:
Bruce Momjian [Thu, 21 Apr 2005 15:20:39 +0000 (15:20 +0000)]
Updated text for bitmaps:

<   Bitmap indexes index single columns that can be combined with other bitmap
<   indexes to dynamically create a composite index to match a specific query.
<   Each index is a bitmap, and the bitmaps are bitwise AND'ed or OR'ed to be
<   combined.  They can index by tid or can be lossy requiring a scan of the
<   heap page to find matching rows, or perhaps use a mixed solution where
<   tids are recorded for pages with only a few matches and per-page bitmaps
<   are used for more dense pages.  Another idea is to use a 32-bit bitmap
<   for every page and set a bit based on the item number mod(32).

>   This feature allows separate indexes to be ANDed or ORed together.  This
>   is particularly useful for data warehousing applications that need to
>   query the database in an many permutations.  This feature scans an index
>   and creates an in-memory bitmap, and allows that bitmap to be combined
>   with other bitmap created in a similar way.  The bitmap can either index
>   all TIDs, or be lossy, meaning it records just page numbers and each
>   page tuple has to be checked for validity in a separate pass.

19 years agoDone:
Bruce Momjian [Thu, 21 Apr 2005 04:09:34 +0000 (04:09 +0000)]
Done:

< * Add tool to query pg_stat_* tables and report indexes that aren't needed
<   or tables that might need indexes

19 years agoInstall some slightly realistic cost estimation for bitmap index scans.
Tom Lane [Thu, 21 Apr 2005 02:28:02 +0000 (02:28 +0000)]
Install some slightly realistic cost estimation for bitmap index scans.

19 years agoMake pg_ctl status do a kill() test to verify that the PID found in
Tom Lane [Wed, 20 Apr 2005 23:10:16 +0000 (23:10 +0000)]
Make pg_ctl status do a kill() test to verify that the PID found in
postmaster.pid still represents a live postmaster.

19 years agoAdd note clarifying that indexes that support ordered scans had better
Tom Lane [Wed, 20 Apr 2005 22:19:58 +0000 (22:19 +0000)]
Add note clarifying that indexes that support ordered scans had better
allow clauseless scans.

19 years agoDon't try to run clauseless index scans on index types that don't support
Tom Lane [Wed, 20 Apr 2005 21:48:04 +0000 (21:48 +0000)]
Don't try to run clauseless index scans on index types that don't support
it.  Per report from Marinos Yannikos.

19 years agoFix mis-display of negative fractional seconds in interval values for
Tom Lane [Wed, 20 Apr 2005 17:14:50 +0000 (17:14 +0000)]
Fix mis-display of negative fractional seconds in interval values for
--enable-integer-datetimes case.  Per report from Oliver Siegmar.

19 years agoMinor performance improvement: avoid unnecessary creation/unioning of
Tom Lane [Wed, 20 Apr 2005 15:48:36 +0000 (15:48 +0000)]
Minor performance improvement: avoid unnecessary creation/unioning of
bitmaps for multiple indexscans.  Instead just let each indexscan add
TIDs directly into the BitmapOr node's result bitmap.

19 years agoAdd:
Bruce Momjian [Wed, 20 Apr 2005 02:48:11 +0000 (02:48 +0000)]
Add:

> * Add tool to query pg_stat_* tables and report indexes that aren't needed
>   or tables that might need indexes

19 years agoAdd:
Bruce Momjian [Wed, 20 Apr 2005 02:43:49 +0000 (02:43 +0000)]
Add:

> * Log queries where the optimizer row estimates were dramatically
>   different from the number of rows actually found (?)

19 years agoAdd:
Bruce Momjian [Wed, 20 Apr 2005 01:17:34 +0000 (01:17 +0000)]
Add:

> * All ability to monitor the use of temporary sort files

19 years agoCreate executor and planner-backend support for decoupled heap and index
Tom Lane [Tue, 19 Apr 2005 22:35:18 +0000 (22:35 +0000)]
Create executor and planner-backend support for decoupled heap and index
scans, using in-memory tuple ID bitmaps as the intermediary.  The planner
frontend (path creation and cost estimation) is not there yet, so none
of this code can be executed.  I have tested it using some hacked planner
code that is far too ugly to see the light of day, however.  Committing
now so that the bulk of the infrastructure changes go in before the tree
drifts under me.

19 years agoAdd comment about permissions on pg_ts* tables
Teodor Sigaev [Tue, 19 Apr 2005 13:58:48 +0000 (13:58 +0000)]
Add comment about permissions on pg_ts* tables

19 years ago>>>>Luckily, PG 8 is available for this. Do you have a short example?
Bruce Momjian [Tue, 19 Apr 2005 03:55:43 +0000 (03:55 +0000)]
>>>>Luckily, PG 8 is available for this.  Do you have a short example?
>>>
>>>No, and I think it should be in the manual as an example.
>>>
>>>You will need to enter a loop that uses exception handling to detect
>>>unique_violation.
>>
>>Pursuant to an IRC discussion to which Dennis Bjorklund and
>>Christopher Kings-Lynne made most of the contributions, please find
>>enclosed an example patch demonstrating an UPSERT-like capability.
>>

David Fetter

19 years ago> >Luckily, PG 8 is available for this. Do you have a short example?
Bruce Momjian [Tue, 19 Apr 2005 03:37:20 +0000 (03:37 +0000)]
> >Luckily, PG 8 is available for this.  Do you have a short example?
>
> No, and I think it should be in the manual as an example.
>
> You will need to enter a loop that uses exception handling to detect
> unique_violation.

Pursuant to an IRC discussion to which Dennis Bjorklund and
Christopher Kings-Lynne made most of the contributions, please find
enclosed an example patch demonstrating an UPSERT-like capability.

David Fetter

19 years agoThe following patch should allow UPDATE_INTERVAL to be specified on the
Bruce Momjian [Tue, 19 Apr 2005 03:35:15 +0000 (03:35 +0000)]
The following patch should allow UPDATE_INTERVAL to be specified on the
command line. We find this useful because we frequently deal with
thousands of tables in an environment where neither the databases nor
the tables are updated frequently. This helps allow us to cut down on
the overhead of updating the list for every other primary loop of
pg_autovacuum.

I chose -i as the command-line argument and documented it briefly in
the README.

The patch was applied to the 7.4.7 version of pg_autovacuum in contrib.

Thomas F.O'Connell

19 years agoAttached patch gets rid of the global timezone in the following steps:
Bruce Momjian [Tue, 19 Apr 2005 03:13:59 +0000 (03:13 +0000)]
Attached patch gets rid of the global timezone in the following steps:

* Changes the APIs to the timezone functions to take a pg_tz pointer as
an argument, representing the timezone to use for the selected
operation.

* Adds a global_timezone variable that represents the current timezone
in the backend as set by SET TIMEZONE (or guc, or env, etc).

* Implements a hash-table cache of loaded tables, so we don't have to
read and parse the TZ file everytime we change a timezone. While not
necesasry now (we don't change timezones very often), I beleive this
will be necessary (or at least good) when "multiple timezones in the
same query" is eventually implemented. And code-wise, this was the time
to do it.

There are no user-visible changes at this time. Implementing the
"multiple zones in one query" is a later step...

This also gets rid of some of the cruft needed to "back out a timezone
change", since we previously couldn't check a timezone unless it was
activated first.

Passes regression tests on win32, linux (slackware 10) and solaris x86.

Magnus Hagander

19 years agoUpdate PITR wording, per Simon.
Bruce Momjian [Tue, 19 Apr 2005 01:39:50 +0000 (01:39 +0000)]
Update PITR wording, per Simon.

19 years agopg_dumpall should enforce the server version check for itself, rather
Tom Lane [Mon, 18 Apr 2005 23:47:52 +0000 (23:47 +0000)]
pg_dumpall should enforce the server version check for itself, rather
than simply passing it down to pg_dump.  Else, version-related failures
in pg_dumpall itself generate unhelpful error messages.

19 years agoAdd WAL entry about compression.
Bruce Momjian [Mon, 18 Apr 2005 18:30:56 +0000 (18:30 +0000)]
Add WAL entry about compression.

19 years agoAdded to TODO:
Bruce Momjian [Mon, 18 Apr 2005 18:29:57 +0000 (18:29 +0000)]
Added to TODO:

> * Compress WAL entries [wal]

19 years agoUpdate PITR setence to mention WAL and file system dump.
Bruce Momjian [Mon, 18 Apr 2005 17:40:40 +0000 (17:40 +0000)]
Update PITR setence to mention WAL and file system dump.

19 years agorecord_in and record_recv must be careful to return a separately
Tom Lane [Mon, 18 Apr 2005 17:11:05 +0000 (17:11 +0000)]
record_in and record_recv must be careful to return a separately
pfree'able result, since some callers expect to be able to pfree
the result of a pass-by-reference function.  Per report from Chris Trawick.

19 years agoUpdate PITR TODO items:
Bruce Momjian [Mon, 18 Apr 2005 15:03:21 +0000 (15:03 +0000)]
Update PITR TODO items:

<   failure.
>   failure.  This could be triggered by a user command or a timer.
< * Force archiving of partially-full WAL files when pg_stop_backup() is
<   called or the server is stopped
> * Automatically force archiving of partially-filled WAL files when
>   pg_stop_backup() is called or the server is stopped

19 years agoUpdate TODO script sample.
Bruce Momjian [Mon, 18 Apr 2005 14:44:04 +0000 (14:44 +0000)]
Update TODO script sample.

19 years agoUpdate for HTML markup.
Bruce Momjian [Mon, 18 Apr 2005 14:42:35 +0000 (14:42 +0000)]
Update for HTML markup.

19 years agoAdd description that WAL files used during backup have to be archived
Bruce Momjian [Mon, 18 Apr 2005 13:11:04 +0000 (13:11 +0000)]
Add description that WAL files used during backup have to be archived
before you are done.

19 years agoAdd HTML version of TODO to CVS, for web site use.
Bruce Momjian [Mon, 18 Apr 2005 12:58:45 +0000 (12:58 +0000)]
Add HTML version of TODO to CVS, for web site use.

19 years agoAdd HTML TODO version to CVS.
Bruce Momjian [Mon, 18 Apr 2005 12:58:11 +0000 (12:58 +0000)]
Add HTML TODO version to CVS.

19 years agoAdd description about partial WAL archiving for PITR:
Bruce Momjian [Mon, 18 Apr 2005 12:51:41 +0000 (12:51 +0000)]
Add description about partial WAL archiving for PITR:

>
>   Doing this will allow administrators to know more easily when the
>   archive contins all the files needed for point-in-time recovery.

19 years agoFix html.
Bruce Momjian [Mon, 18 Apr 2005 03:46:31 +0000 (03:46 +0000)]
Fix html.

19 years agoTest new html tag.
Bruce Momjian [Mon, 18 Apr 2005 03:17:23 +0000 (03:17 +0000)]
Test new html tag.

19 years agoAdd:
Bruce Momjian [Mon, 18 Apr 2005 03:00:44 +0000 (03:00 +0000)]
Add:

> * Force archiving of partially-full WAL files when pg_stop_backup() is
>   called or the server is stopped

19 years agoUpdate PITR mention of which WAL files are needed.
Bruce Momjian [Mon, 18 Apr 2005 01:29:00 +0000 (01:29 +0000)]
Update PITR mention of which WAL files are needed.

19 years agoInitial implementation of lossy-tuple-bitmap data structures.
Tom Lane [Sun, 17 Apr 2005 22:24:02 +0000 (22:24 +0000)]
Initial implementation of lossy-tuple-bitmap data structures.
Not connected to anything useful yet ...

19 years agoClarify name of file to be checked for PITR expiring.
Bruce Momjian [Sun, 17 Apr 2005 03:05:19 +0000 (03:05 +0000)]
Clarify name of file to be checked for PITR expiring.

19 years agoFix comment typo.
Bruce Momjian [Sun, 17 Apr 2005 03:04:29 +0000 (03:04 +0000)]
Fix comment typo.

19 years agoCreate a new 'MultiExecProcNode' call API for plan nodes that don't
Tom Lane [Sat, 16 Apr 2005 20:07:35 +0000 (20:07 +0000)]
Create a new 'MultiExecProcNode' call API for plan nodes that don't
return just a single tuple at a time.  Currently the only such node
type is Hash, but I expect we will soon have indexscans that can return
tuple bitmaps.  A side benefit is that EXPLAIN ANALYZE now shows the
correct tuple count for a Hash node.

19 years agoMinor improvements to locale documentation.
Tom Lane [Sat, 16 Apr 2005 16:50:01 +0000 (16:50 +0000)]
Minor improvements to locale documentation.

19 years agoReduce PANIC to ERROR in several xlog routines that are used in both
Tom Lane [Fri, 15 Apr 2005 22:19:48 +0000 (22:19 +0000)]
Reduce PANIC to ERROR in several xlog routines that are used in both
critical and noncritical contexts (an example of noncritical being
post-checkpoint removal of dead xlog segments).  In the critical cases
the CRIT_SECTION mechanism will cause ERROR to be promoted to PANIC
anyway, and in the noncritical cases we shouldn't let an error take
down the entire database.  Arguably there should be *no* explicit
PANIC errors in this module, only more START/END_CRIT_SECTION calls,
but I didn't go that far.  (Yet.)

19 years agoModify MoveOfflineLogs/InstallXLogFileSegment to avoid O(N^2) behavior
Tom Lane [Fri, 15 Apr 2005 18:48:10 +0000 (18:48 +0000)]
Modify MoveOfflineLogs/InstallXLogFileSegment to avoid O(N^2) behavior
when recycling a large number of xlog segments during checkpoint.
The former behavior searched from the same start point each time,
requiring O(checkpoint_segments^2) stat() calls to relocate all the
segments.  Instead keep track of where we stopped last time through.

19 years agoRevert addition of poorly-thought-out DUMP TIMESTAMP archive entry,
Tom Lane [Fri, 15 Apr 2005 16:40:36 +0000 (16:40 +0000)]
Revert addition of poorly-thought-out DUMP TIMESTAMP archive entry,
which induced bug #1597 in addition to having several other misbehaviors
(like labeling the dump with a completion time having nothing to do with
reality).  Instead just print out the desired strings where RestoreArchive
was already emitting the 'PostgreSQL database dump' and
'PostgreSQL database dump complete' strings.

19 years agoThis patch changes the use of varargs.h to stdarg.h as
Neil Conway [Fri, 15 Apr 2005 04:29:32 +0000 (04:29 +0000)]
This patch changes the use of varargs.h to stdarg.h as
required by modern versions of GCC.

Niels Breet

19 years agoRemove an unused variable "waitingForSignal". From Qingqing Zhou.
Neil Conway [Fri, 15 Apr 2005 04:18:10 +0000 (04:18 +0000)]
Remove an unused variable "waitingForSignal". From Qingqing Zhou.

19 years agoDone
Bruce Momjian [Thu, 14 Apr 2005 23:20:55 +0000 (23:20 +0000)]
Done
> * -Use indexes for MIN() and MAX()

19 years agoMake equalTupleDescs() compare attlen/attbyval/attalign rather than
Tom Lane [Thu, 14 Apr 2005 22:34:48 +0000 (22:34 +0000)]
Make equalTupleDescs() compare attlen/attbyval/attalign rather than
assuming comparison of atttypid is sufficient.  In a dropped column
atttypid will be 0, and we'd better check the physical-storage data
to make sure the tupdescs are physically compatible.
I do not believe there is a real risk before 8.0, since before that
we only used this routine to compare successive states of the tupdesc
for a particular relation.  But 8.0's typcache.c might be comparing
arbitrary tupdescs so we'd better play it safer.

19 years agoPut back blessing of record-function tupledesc, which I removed in a
Tom Lane [Thu, 14 Apr 2005 22:09:40 +0000 (22:09 +0000)]
Put back blessing of record-function tupledesc, which I removed in a
fit of over-optimization.

19 years agoDon't try to constant-fold functions returning RECORD, since the optimizer
Tom Lane [Thu, 14 Apr 2005 21:44:09 +0000 (21:44 +0000)]
Don't try to constant-fold functions returning RECORD, since the optimizer
isn't presently set up to pass them an expected tuple descriptor.  Bug has
been there since 7.3 but was just recently reported by Thomas Hallgren.

19 years agoMust count '*' characters as potential arguments.
Tom Lane [Thu, 14 Apr 2005 20:53:09 +0000 (20:53 +0000)]
Must count '*' characters as potential arguments.

19 years agoMarginal hack to use a specialized hash function for dynahash hashtables
Tom Lane [Thu, 14 Apr 2005 20:32:43 +0000 (20:32 +0000)]
Marginal hack to use a specialized hash function for dynahash hashtables
whose keys are OIDs.  The only one that looks particularly performance
critical is the relcache hashtable, but as long as we've got the function
we may as well use it wherever it's applicable.

19 years agoCompletion of project to use fixed OIDs for all system catalogs and
Tom Lane [Thu, 14 Apr 2005 20:03:27 +0000 (20:03 +0000)]
Completion of project to use fixed OIDs for all system catalogs and
indexes.  Replace all heap_openr and index_openr calls by heap_open
and index_open.  Remove runtime lookups of catalog OID numbers in
various places.  Remove relcache's support for looking up system
catalogs by name.  Bulky but mostly very boring patch ...

19 years agoAdded patch by Philip Yarra <philip.yarra@internode.on.net> for a bug in thread support.
Michael Meskes [Thu, 14 Apr 2005 10:08:57 +0000 (10:08 +0000)]
Added patch by Philip Yarra <philip.yarra@internode.on.net> for a bug in thread support.

19 years agoFirst phase of project to use fixed OIDs for all system catalogs and
Tom Lane [Thu, 14 Apr 2005 01:38:22 +0000 (01:38 +0000)]
First phase of project to use fixed OIDs for all system catalogs and
indexes.  Extend the macros in include/catalog/*.h to carry the info
about hand-assigned OIDs, and adjust the genbki script and bootstrap
code to make the relations actually get those OIDs.  Remove the small
number of RelOid_pg_foo macros that we had in favor of a complete
set named like the catname.h and indexing.h macros.  Next phase will
get rid of internal use of names for looking up catalogs and indexes;
but this completes the changes forcing an initdb, so it looks like a
good place to commit.
Along the way, I made the shared relations (pg_database etc) not be
'bootstrap' relations any more, so as to reduce the number of hardwired
entries and simplify changing those relations in future.  I'm not
sure whether they ever really needed to be handled as bootstrap
relations, but it seems to work fine to not do so now.

19 years agoSimplify initdb-time assignment of OIDs as I proposed yesterday, and
Tom Lane [Wed, 13 Apr 2005 18:54:57 +0000 (18:54 +0000)]
Simplify initdb-time assignment of OIDs as I proposed yesterday, and
avoid encroaching on the 'user' range of OIDs by allowing automatic
OID assignment to use values below 16k until we reach normal operation.

initdb not forced since this doesn't make any incompatible change;
however a lot of stuff will have different OIDs after your next initdb.

19 years agoChange addRangeTableEntryForRelation() to take a Relation pointer instead
Tom Lane [Wed, 13 Apr 2005 16:50:55 +0000 (16:50 +0000)]
Change addRangeTableEntryForRelation() to take a Relation pointer instead
of just a relation OID, thereby not having to open the relation for itself.
This actually saves code rather than adding it for most of the existing
callers, which had the rel open already.  The main point though is to be
able to use this rather than plain addRangeTableEntry in setTargetTable,
thus saving one relation_openrv/relation_close cycle for every INSERT,
UPDATE, or DELETE.  Seems to provide a several percent win on simple
INSERTs.

19 years agoRevert yesterday's change to make pg_cast.h say 'OID = 0' in DATA entries.
Tom Lane [Wed, 13 Apr 2005 16:15:35 +0000 (16:15 +0000)]
Revert yesterday's change to make pg_cast.h say 'OID = 0' in DATA entries.
On reflection, we ought to get rid of that mechanism entirely.

19 years agoMinor consistency improvement to the documentation on array functions.
Neil Conway [Wed, 13 Apr 2005 00:20:10 +0000 (00:20 +0000)]
Minor consistency improvement to the documentation on array functions.

19 years agoAdjust pg_cast.h so that the OIDs assigned to built-in casts come from
Tom Lane [Tue, 12 Apr 2005 19:45:43 +0000 (19:45 +0000)]
Adjust pg_cast.h so that the OIDs assigned to built-in casts come from
genbki.sh's pool (10000-16383) instead of being run-time assigned by
heap_insert.  Might as well use the pool as long as it's there ...
I was a bit bemused to realize that it hadn't been in use at all since 7.2.

initdb not forced since this doesn't really affect anything.  The OIDs
of casts and system indexes will change next time you do one, though.

19 years agoRemove unnecessary UPDATE commands to assign explicit ACLs to functions
Tom Lane [Tue, 12 Apr 2005 19:29:24 +0000 (19:29 +0000)]
Remove unnecessary UPDATE commands to assign explicit ACLs to functions
and PL languages during initdb.  The default permissions for these objects
are the same as what we were assigning anyway, so there is no need to
expend space in the catalogs on them.  The space cost is particularly
significant in pg_proc's indexes, which are bloated by about a factor of 2
by the full-table update, and can never really recover the space.
initdb not forced, since the change has no actual impact on behavior.

19 years agoRevert mistaken renaming of UTF-8.
Peter Eisentraut [Tue, 12 Apr 2005 14:19:43 +0000 (14:19 +0000)]
Revert mistaken renaming of UTF-8.

19 years agoFix oversight in MIN/MAX optimization: must not return NULL entries
Tom Lane [Tue, 12 Apr 2005 05:11:28 +0000 (05:11 +0000)]
Fix oversight in MIN/MAX optimization: must not return NULL entries
from index, since the aggregates ignore NULLs.

19 years agoAdd aggsortop column to pg_aggregate, so that MIN/MAX optimization can
Tom Lane [Tue, 12 Apr 2005 04:26:34 +0000 (04:26 +0000)]
Add aggsortop column to pg_aggregate, so that MIN/MAX optimization can
be supported for all datatypes.  Add CREATE AGGREGATE and pg_dump support
too.  Add specialized min/max aggregates for bpchar, instead of depending
on text's min/max, because otherwise the possible use of bpchar indexes
cannot be recognized.
initdb forced because of catalog changes.

19 years agoFix broken markup.
Tom Lane [Tue, 12 Apr 2005 03:16:50 +0000 (03:16 +0000)]
Fix broken markup.

19 years agoCreate the planner mechanism for optimizing simple MIN and MAX queries
Tom Lane [Mon, 11 Apr 2005 23:06:57 +0000 (23:06 +0000)]
Create the planner mechanism for optimizing simple MIN and MAX queries
into indexscans on matching indexes.  For the moment, it only handles
int4 and text datatypes; next step is to add a column to pg_aggregate
so that all MIN/MAX aggregates can be handled.  Per my recent proposal.

19 years agoFix interaction between materializing holdable cursors and firing
Tom Lane [Mon, 11 Apr 2005 19:51:16 +0000 (19:51 +0000)]
Fix interaction between materializing holdable cursors and firing
deferred triggers: either one can create more work for the other,
so we have to loop till it's all gone.  Per example from andrew@supernews.
Add a regression test to help spot trouble in this area in future.

19 years agoPersistHoldablePortal must establish the correct value for ActiveSnapshot
Tom Lane [Mon, 11 Apr 2005 15:59:34 +0000 (15:59 +0000)]
PersistHoldablePortal must establish the correct value for ActiveSnapshot
while completing execution of the cursor's query.  Otherwise we get wrong
answers or even crashes from non-volatile functions called by the query.
Per report from andrew@supernews.

19 years agoUpdate to XHTML.
Bruce Momjian [Sun, 10 Apr 2005 23:21:33 +0000 (23:21 +0000)]
Update to XHTML.

19 years agoMake constant-folding produce sane output for COALESCE(NULL,NULL),
Tom Lane [Sun, 10 Apr 2005 20:57:32 +0000 (20:57 +0000)]
Make constant-folding produce sane output for COALESCE(NULL,NULL),
that is a plain NULL and not a COALESCE with no inputs.  Fixes crash
reported by Michael Williamson.

19 years agoSplit out into a separate function the code in grouping_planner() that
Tom Lane [Sun, 10 Apr 2005 19:50:08 +0000 (19:50 +0000)]
Split out into a separate function the code in grouping_planner() that
decides whether to use hashed grouping instead of sort-plus-uniq
grouping. The function needs an annoyingly large number of parameters,
but this still seems like a win for legibility, since it removes over
a hundred lines from grouping_planner (which is still too big :-().

19 years agoSQL functions returning pass-by-reference types were copying the results
Tom Lane [Sun, 10 Apr 2005 18:04:20 +0000 (18:04 +0000)]
SQL functions returning pass-by-reference types were copying the results
into the wrong memory context, resulting in a query-lifespan memory leak.
Bug is new in 8.0, I believe.  Per report from Rae Stiening.

19 years agoDone:
Bruce Momjian [Sat, 9 Apr 2005 04:07:03 +0000 (04:07 +0000)]
Done:

< * Allow additional tables to be specified in DELETE for joins
> * -Allow additional tables to be specified in DELETE for joins

19 years agoWe don't put URL's in ulink's because the URL is always generated, but
Bruce Momjian [Sat, 9 Apr 2005 03:52:43 +0000 (03:52 +0000)]
We don't put URL's in ulink's because the URL is always generated, but
we can put words in ulink and the URL will still be printed.

per Peter

19 years agoIf we're going to have a non-panic check for held_lwlocks[] overrun,
Tom Lane [Fri, 8 Apr 2005 14:18:35 +0000 (14:18 +0000)]
If we're going to have a non-panic check for held_lwlocks[] overrun,
it must occur *before* we get into the critical state of holding a
lock we have no place to record.  Per discussion with Qingqing Zhou.

19 years agoUse an always-there test, not an Assert, to check for overrun of
Tom Lane [Fri, 8 Apr 2005 03:43:54 +0000 (03:43 +0000)]
Use an always-there test, not an Assert, to check for overrun of
the held_lwlocks[] array.  Per Qingqing Zhou.

19 years agoChange the default setting of "add_missing_from" to false. This has been
Neil Conway [Fri, 8 Apr 2005 00:59:59 +0000 (00:59 +0000)]
Change the default setting of "add_missing_from" to false. This has been
the long-term plan for this behavior for quite some time, but it is only
possible now that DELETE has a USING clause so that the user can join
other tables in a DELETE statement without relying on this behavior.

19 years agoUse fork_process() to avoid some fork()-related boilerplate code when
Neil Conway [Fri, 8 Apr 2005 00:55:07 +0000 (00:55 +0000)]
Use fork_process() to avoid some fork()-related boilerplate code when
forking the stats collector child process.

19 years agoUpdate and copy-edit release notes for 8.0.2.
Tom Lane [Thu, 7 Apr 2005 19:04:13 +0000 (19:04 +0000)]
Update and copy-edit release notes for 8.0.2.

19 years agoFix some issues with missing or too many newlines at
Tom Lane [Thu, 7 Apr 2005 15:23:06 +0000 (15:23 +0000)]
Fix some issues with missing or too many newlines at
end of file.

19 years agoAllow plpgsql functions to omit RETURN command when the function returns
Tom Lane [Thu, 7 Apr 2005 14:53:04 +0000 (14:53 +0000)]
Allow plpgsql functions to omit RETURN command when the function returns
output parameters or VOID or a set.  There seems no particular reason to
insist on a RETURN in these cases, since the function return value is
determined by other elements anyway.  Per recent discussion.

19 years agoMinor documentation tweak.
Neil Conway [Thu, 7 Apr 2005 03:31:42 +0000 (03:31 +0000)]
Minor documentation tweak.

19 years agoFix minor breakage to regression tests induced in previous commit -- I had
Neil Conway [Thu, 7 Apr 2005 03:29:01 +0000 (03:29 +0000)]
Fix minor breakage to regression tests induced in previous commit -- I had
updated the expected/ output, not the output/ output. Apologies.

19 years agoAdd a "USING" clause to DELETE, which is equivalent to the FROM clause
Neil Conway [Thu, 7 Apr 2005 01:51:41 +0000 (01:51 +0000)]
Add a "USING" clause to DELETE, which is equivalent to the FROM clause
in UPDATE. We also now issue a NOTICE if a query has _any_ implicit
range table entries -- in the past, we would only warn about implicit
RTEs in SELECTs with at least one explicit RTE.

As a result of the warning change, 25 of the regression tests had to
be updated. I also took the opportunity to remove some bogus whitespace
differences between some of the float4 and float8 variants. I believe
I have correctly updated all the platform-specific variants, but let
me know if that's not the case.

Original patch for DELETE ... USING from Euler Taveira de Oliveira,
reworked by Neil Conway.

19 years agoApply the "nodeAgg" optimization to more of the builtin transition
Neil Conway [Wed, 6 Apr 2005 23:56:07 +0000 (23:56 +0000)]
Apply the "nodeAgg" optimization to more of the builtin transition
functions. This patch optimizes int2_sum(), int4_sum(), float4_accum()
and float8_accum() to avoid needing to copy the transition function's
state for each input tuple of the aggregate. In an extreme case
(e.g. SELECT sum(int2_col) FROM table where table has a single column),
it improves performance by about 20%. For more complex queries or tables
with wider rows, the relative performance improvement will not be as
significant.

19 years agoRemove test for NULL node in ExecProcNode(). No place ever calls
Tom Lane [Wed, 6 Apr 2005 20:13:49 +0000 (20:13 +0000)]
Remove test for NULL node in ExecProcNode().  No place ever calls
ExecProcNode() with a NULL value, so the test couldn't do anything
for us except maybe mask bugs.  Removing it probably doesn't save
anything much either, but then again this is a hot-spot routine.

19 years agoMerge Resdom nodes into TargetEntry nodes to simplify code and save a
Tom Lane [Wed, 6 Apr 2005 16:34:07 +0000 (16:34 +0000)]
Merge Resdom nodes into TargetEntry nodes to simplify code and save a
few palloc's.  I also chose to eliminate the restype and restypmod fields
entirely, since they are redundant with information stored in the node's
contained expression; re-examining the expression at need seems simpler
and more reliable than trying to keep restype/restypmod up to date.

initdb forced due to change in contents of stored rules.