Tom Lane [Thu, 12 Apr 2007 15:04:35 +0000 (15:04 +0000)]
Cancel pending fsync requests during WAL replay of DROP DATABASE, per bug
report from David Darville. Back-patch as far as 8.1, which may or may not
have the problem but it seems a safe change anyway.
Neil Conway [Thu, 12 Apr 2007 06:53:49 +0000 (06:53 +0000)]
RESET SESSION, plus related new DDL commands. Patch from Marko Kreen,
reviewed by Neil Conway. This patch adds the following DDL command
variants: RESET SESSION, RESET TEMP, RESET PLANS, CLOSE ALL, and
DEALLOCATE ALL. RESET SESSION is intended for use by connection
pool software and the like, in order to reset a client session
to something close to its initial state.
Note that while most of these command variants can be executed
inside a transaction block (but are not transaction-aware!),
RESET SESSION cannot. While this is inconsistent, it is intended
to catch programmer mistakes: RESET SESSION in an open transaction
block is probably unintended.
Tom Lane [Wed, 11 Apr 2007 20:47:38 +0000 (20:47 +0000)]
Code review for btree page split WAL reduction patch. Make it actually work
(original code *always* created a full-page image for the left page, thus
leaving the intended savings unrealized), avoid risk of not having enough room
on the page during xlog restore, squeeze out another couple bytes in the xlog
record, clean up neglected comments.
Tom Lane [Mon, 9 Apr 2007 22:04:08 +0000 (22:04 +0000)]
Minor tweaking of index special-space definitions so that the various
index types can be reliably distinguished by examining the special space
on an index page. Per my earlier proposal, plus the realization that
there's no need for btree's vacuum cycle ID to cycle through every possible
16-bit value. Restricting its range a little costs nearly nothing and
eliminates the possibility of collisions.
Memo to self: remember to make bitmap indexes play along with this scheme,
assuming that patch ever gets accepted.
Add -F option to set fillfactor for tellers, accounts and branches.
Patch contributed by Pavan Deolasee. Along with Japanese doc
modification by Tatsuo Ishii.
Tom Lane [Fri, 6 Apr 2007 22:57:20 +0000 (22:57 +0000)]
Don't remove the 'alias' field from flattened rangetable entries;
there are some corner cases where this is needed by ruleutils.c for
proper display of variables during EXPLAIN.
Enhance pgbench -l option to add timestamp. Patch contributed by Greg
Smith. Along with Japanese doc updation by Tasuo Ishii.
> This patch changes the way pgbench outputs its latency log files so that
> every transaction gets a timestamp and notes which transaction type was
> executed. It's a one-line change that just dumps some additional
> information that was already sitting in that area of code. I also made a
> couple of documentation corrections and clarifications on some of the more
> confusing features of pgbench.
>
> It's straightforward to parse log files in this format to analyze what
> happened during the test at a higher level than was possible with the
> original format. You can find some rough sample code to convert this
> latency format into CVS files and then into graphs at
> http://www.westnet.com/~gsmith/content/postgresql/pgbench.htm which I'll
> be expanding on once I get all my little patches sent in here.
Various pgbench enhancements. Patch contributed by ITAGAKI Takahiro.
Also tweak README.pgbench/README.pgbench_jis:
Remove history after pgbench was added to PostgreSQL contrib module.
Those info was not only redundant since it has already been in CVS
log, but also incomplete.
--------------------------------------------------------------------------
The attached is a patch to optimize contrib/pgbench using new 8.3 features.
- Use DROP IF EXISTS to suppress errors for initial loadings.
- Use a combination of TRUNCATE and COPY to reduce WAL on creating
the accounts table.
Also, there are some cosmetic changes.
- Change the output of -v option from "starting full vacuum..."
to "starting vacuum accounts..." in reflection of the fact.
- Shape duplicated error checks into executeStatement().
There is a big performance win in "COPY with no WAL" feature.
Thanks for the efforts!
--------------------------------------------------------------------------
Tom Lane [Fri, 6 Apr 2007 05:36:51 +0000 (05:36 +0000)]
Now that core functionality is depending on autoconf's AC_C_BIGENDIAN to be
right, there seems precious little reason to have a pile of hand-maintained
endianness definitions in src/include/port/*.h. Get rid of those, and make
the couple of places that used them depend on WORDS_BIGENDIAN instead.
Tom Lane [Fri, 6 Apr 2007 04:21:44 +0000 (04:21 +0000)]
Support varlena fields with single-byte headers and unaligned storage.
This commit breaks any code that assumes that the mere act of forming a tuple
(without writing it to disk) does not "toast" any fields. While all available
regression tests pass, I'm not totally sure that we've fixed every nook and
cranny, especially in contrib.
Bruce Momjian [Thu, 5 Apr 2007 02:08:53 +0000 (02:08 +0000)]
Add URL for:
* Reduce WAL traffic so only modified values are written rather than
entire rows
>
> http://archives.postgresql.org/pgsql-hackers/2007-03/msg01589.php
>
Bruce Momjian [Wed, 4 Apr 2007 17:28:11 +0000 (17:28 +0000)]
Remove plpython casts C source code casts:
It removes last remaining casts inside struct definitions.
Such usage is bad practice, as it hides problems from compiler.
Reason for the cast is popular practice in some circles
to define functions as foo(MyObj *) instead of foo(PyObject *)
thus avoiding a local variable inside functions and make
direct calling easier. As pl/python does not use such style,
the casts were unnecessary from the start.
Tom Lane [Tue, 3 Apr 2007 16:34:36 +0000 (16:34 +0000)]
Remove the CheckpointStartLock in favor of having backends show whether they
are in their commit critical sections via flags in the ProcArray. Checkpoint
can watch the ProcArray to determine when it's safe to proceed. This is
a considerably better solution to the original problem of race conditions
between checkpoint and transaction commit: it speeds up commit, since there's
one less lock to fool with, and it prevents the problem of checkpoint being
delayed indefinitely when there's a constant flow of commits. Heikki, with
some kibitzing from Tom.
Tom Lane [Tue, 3 Apr 2007 04:14:26 +0000 (04:14 +0000)]
Decouple the values of TOAST_TUPLE_THRESHOLD and TOAST_MAX_CHUNK_SIZE.
Add the latter to the values checked in pg_control, since it can't be changed
without invalidating toast table content. This commit in itself shouldn't
change any behavior, but it lays some necessary groundwork for experimentation
with these toast-control numbers.
Note: while TOAST_TUPLE_THRESHOLD can now be changed without initdb, some
thought still needs to be given to needs_toast_table() in toasting.c before
unleashing random changes.
Bruce Momjian [Tue, 3 Apr 2007 02:17:11 +0000 (02:17 +0000)]
Update:
< * Add idle_timeout GUC so locks are not held for log periods of time
> * Add transaction_idle_timeout GUC so locks are not held for long
> periods of time
Bruce Momjian [Mon, 2 Apr 2007 22:49:03 +0000 (22:49 +0000)]
Add URL for:
* Improve speed with indexes
For large table adjustments during VACUUM FULL, it is faster to cluster
or reindex rather than update the index. Also, index updates can bloat
the index.
Bruce Momjian [Mon, 2 Apr 2007 22:46:10 +0000 (22:46 +0000)]
Add:
> o Have timestamp subtraction not call justify_hours()?
>
> http://archives.postgresql.org/pgsql-sql/2006-10/msg00059.php
>
< o Add overflow checking to timestamp and interval arithmetic
> o Add overflow checking to timestamp and interval arithmetic
Bruce Momjian [Mon, 2 Apr 2007 22:20:53 +0000 (22:20 +0000)]
Allow NOTIFY/LISTEN/UNLISTEN to only take relation names, not
schema.relation, because the notify code only honors the relation name.
schema.relation will now generate a syntax error.
Bruce Momjian [Mon, 2 Apr 2007 21:28:10 +0000 (21:28 +0000)]
Pl/python -> Pl/PythonU:
< o Add table function support to pltcl, plpython
> o Add table function support to pltcl, plpythonu
< o Add PL/Python tracebacks
> o Add PL/PythonU tracebacks
< o Allow PL/Python to return boolean rather than 1/0
> o Allow PL/PythonU to return boolean rather than 1/0
Bruce Momjian [Mon, 2 Apr 2007 20:10:16 +0000 (20:10 +0000)]
Add URL for:
o Allow RETURN to return row or record functions
> o Allow RETURN to return row or record functions
> http://archives.postgresql.org/pgsql-patches/2006-08/msg00397.php
> http://archives.postgresql.org/pgsql-hackers/2006-09/msg00388.php
Tom Lane [Mon, 2 Apr 2007 18:49:29 +0000 (18:49 +0000)]
Fix check_sql_fn_retval to allow the case where a SQL function declared to
return void ends with a SELECT, if that SELECT has a single result that is
also of type void. Without this, it's hard to write a void function that
calls another void function. Per gripe from Peter.
Bruce Momjian [Mon, 2 Apr 2007 17:18:44 +0000 (17:18 +0000)]
Done:
< * Support a data type with specific enumerated values (ENUM)
<
< http://archives.postgresql.org/pgsql-hackers/2006-08/msg00979.php
<
> * -Support a data type with specific enumerated values (ENUM)
Tom Lane [Mon, 2 Apr 2007 03:49:42 +0000 (03:49 +0000)]
Support enum data types. Along the way, use macros for the values of
pg_type.typtype whereever practical. Tom Dunstan, with some kibitzing
from Tom Lane.
Tom Lane [Fri, 30 Mar 2007 00:12:59 +0000 (00:12 +0000)]
Fix oversight in coding of _bt_start_vacuum: we can't assume that the LWLock
will be released by transaction abort before _bt_end_vacuum gets called.
If either of these "can't happen" errors actually happened, we'd freeze up
trying to acquire an already-held lock. Latest word is that this does
not explain Martin Pitt's trouble report, but it still looks like a bug.
Bruce Momjian [Thu, 29 Mar 2007 20:23:56 +0000 (20:23 +0000)]
Update item:
o Add more logical syntax CLUSTER table USING index;
< o Add more logical syntax CLUSTER table ORDER BY index;
> o Add more logical syntax CLUSTER table USING index;
Tom Lane [Thu, 29 Mar 2007 19:10:10 +0000 (19:10 +0000)]
exec_parse_message neglected to copy parameter type array into the
required memory context when handling client-specified parameter types
for an unnamed statement. Per report from Kris Jurka.
Magnus Hagander [Thu, 29 Mar 2007 15:30:52 +0000 (15:30 +0000)]
Make ECPG regression tests use native threading instead of pthreads, now that
ecpglib supports it.
Change configure (patch from Bruce) and msvc build system to no longer require
pthreads on win32, since all parts of postgresql can be thread-safe using the
native platform functions.
Tom Lane [Thu, 29 Mar 2007 00:15:39 +0000 (00:15 +0000)]
Teach CLUSTER to skip writing WAL if not needed (ie, not using archiving)
--- Simon.
Also, code review and cleanup for the previous COPY-no-WAL patches --- Tom.
Neil Conway [Wed, 28 Mar 2007 22:59:37 +0000 (22:59 +0000)]
Code cleanup for the new regexp UDFs: we can hardcode the OID and some
properties of the "text" type, and then simplify the code accordingly.
Patch from Jeremy Drake.
Alvaro Herrera [Wed, 28 Mar 2007 22:17:12 +0000 (22:17 +0000)]
Add the "recheck" logic to autovacuum worker code. The worker first builds
its table list and then rechecks pgstat before vacuuming each table to
verify that no one has vacuumed the table in the meantime.
In the current autovacuum world this only means that a worker will not
vacuum a table that a user has vacuumed manually after the worker started.
When support for multiple autovacuum workers is introduced, this will reduce
the probability of simultaneous workers on the same database doing redundant
work.
Tom Lane [Tue, 27 Mar 2007 23:21:12 +0000 (23:21 +0000)]
Fix array coercion expressions to ensure that the correct volatility is
seen by code inspecting the expression. The best way to do this seems
to be to drop the original representation as a function invocation, and
instead make a special expression node type that represents applying
the element-type coercion function to each array element. In this way
the element function is exposed and will be checked for volatility.
Per report from Guillaume Smet.
Alvaro Herrera [Tue, 27 Mar 2007 20:36:03 +0000 (20:36 +0000)]
Cosmetic changes: rename some struct fields, and move the fetching of pgstat
table entries to a separate routine. Don't pass the pgstat database entry to
do_autovacuum; rather, have it fetch it by itself.