Bruce Momjian [Mon, 29 Nov 2004 02:29:28 +0000 (02:29 +0000)]
Add:
> * Auto-vacuum
> o Move into the backend code
> o Scan the buffer cache to find free space or use background writer
> o Use free-space map information to guide refilling
Tom Lane [Sun, 28 Nov 2004 22:16:31 +0000 (22:16 +0000)]
Avoid scribbling on original parsetree during DECLARE CURSOR. This
prevents problems when the DECLARE is in a portal and is executed
repeatedly, as is possible in v3 protocol. Per analysis by Oliver
Jowett, though I didn't use his patch exactly.
Bruce Momjian [Sun, 28 Nov 2004 05:12:19 +0000 (05:12 +0000)]
Add description:
< information, either by name or offset from UTC
> information, either zone name or offset from UTC
>
> If the TIMESTAMP value is stored with a time zone name, interval
> computations should adjust based on the time zone rules, e.g. adding
> 24 hours to a timestamp would yield a different result from adding one
> day.
>
Peter Eisentraut [Sat, 27 Nov 2004 22:44:15 +0000 (22:44 +0000)]
Work around lack of NLS support in libpgport by making those components
who use it scan the relevant source files for their own catalog. It
creates a bit of duplicate work for translators, but it gets the job done
for now.
Tom Lane [Sat, 27 Nov 2004 00:01:02 +0000 (00:01 +0000)]
This adds mention of my latest tweak to the tsearch2/pg_trgm
integration. It is much better to create a word list of unstemmed words
than stemmed ones.
Tom Lane [Wed, 24 Nov 2004 22:56:54 +0000 (22:56 +0000)]
Install Tcl regex fixes to sync our regex engine with Tcl 8.4.8 (up from
8.4.1). This corrects some curious regex bugs, though not the greediness
issue I was hoping to find a solution for :-(
Tom Lane [Wed, 24 Nov 2004 22:44:07 +0000 (22:44 +0000)]
Our interface code for Spencer's regexp package was checking for regexp
error conditions during regexp compile, but not during regexp execution;
any sort of "can't happen" errors would be treated as no-match instead
of being reported as they should be. Noticed while trying to duplicate
a reported Tcl bug.
Tom Lane [Wed, 24 Nov 2004 19:51:05 +0000 (19:51 +0000)]
A client_encoding specification coming from the connection request has
to be processed by GUC before InitPostgres, because any required lookup
of the encoding conversion function has to be done during InitializeClientEncoding.
So, I broke this last week by moving GUC processing to after InitPostgres :-(.
What we can do as a compromise is process non-SUSET variables during
command line scanning (the same as before), and postpone the processing
of only SUSET variables. None of the SUSET variables need to be set
before InitPostgres.
Neil Conway [Wed, 24 Nov 2004 04:58:42 +0000 (04:58 +0000)]
Trivial fix for a bug introduced in r1.94 of help.c: we want to only
include "\s" in \? output when readline is enabled, but that commit
supressed "\s" whether readline was enabled or not.
Tom Lane [Tue, 23 Nov 2004 00:21:24 +0000 (00:21 +0000)]
Further plperl cleanup: be more paranoid about checking the type of
data returned from Perl. Consolidate multiple bits of code to convert
a Perl hash to a tuple, and drive the conversion off the keys present
in the hash rather than the tuple column names, so we detect error if
the hash contains keys it shouldn't. (This means keys not in the hash
will silently default to NULL, which seems ok to me.) Fix a bunch of
reference-count leaks too.
Tom Lane [Mon, 22 Nov 2004 20:31:53 +0000 (20:31 +0000)]
Try to instill some sanity in plperl's function result processing.
Get rid of static variables for SETOF result, don't crash when called
from non-FROM context, eliminate dead code, etc.
Tom Lane [Sun, 21 Nov 2004 22:57:00 +0000 (22:57 +0000)]
Fix rounding problem in dynahash.c's decision about when the target
fill factor has been exceeded. We usually run with ffactor == 1, but
the way the test was coded, it wouldn't split a bucket until the actual
fill factor reached 2.0, because of use of integer division. Change
from > to >= so that it will split more aggressively when the table
starts to get full.
Tom Lane [Sun, 21 Nov 2004 22:48:01 +0000 (22:48 +0000)]
Reduce the default size of the PortalHashTable in order to save a
few cycles during transaction exit. A typical session probably
wouldn't have as many as half a dozen portals open at once, so the
original value of 64 seems far larger than needed.
Tom Lane [Sun, 21 Nov 2004 22:27:34 +0000 (22:27 +0000)]
While fixing plperl and pltcl, I realized plpgsql wasn't doing
subtransactions quite right either: the ReleaseCurrentSubTransaction
call should occur inside the PG_TRY, so that the proper path is taken
if an error occurs during subtransaction commit. This assumes that
AbortSubTransaction can cope with the state left behind if
CommitSubTransaction fails partway through, but we were already
requiring that.
Tom Lane [Sun, 21 Nov 2004 21:17:07 +0000 (21:17 +0000)]
Fix plperl and pltcl error handling per my previous proposal. SPI
operations are now run as subtransactions, so that errors in them
can be reported as ordinary Perl or Tcl errors and caught by the
normal error handling convention of those languages. Also do some
minor code cleanup in pltcl.c: extract a large chunk of duplicated
code in pltcl_SPI_execute and pltcl_SPI_execute_plan into a shared
subroutine.
Tom Lane [Sat, 20 Nov 2004 20:19:52 +0000 (20:19 +0000)]
Avoid scanning the relcache during AtEOSubXact_RelationCache when there
is nothing to do, which is most of the time. This is another simple
improvement to cut subtransaction entry/exit overhead.
Tom Lane [Sat, 20 Nov 2004 20:16:54 +0000 (20:16 +0000)]
Reduce the default size of the local lock hash table. There's usually
no need for it to be nearly as big as the global hash table, and since
it's not in shared memory it can grow if it does need to be bigger.
By reducing the size, we speed up hash_seq_search(), which saves a
significant fraction of subtransaction entry/exit overhead.
Tom Lane [Sat, 20 Nov 2004 19:07:40 +0000 (19:07 +0000)]
Fix plperl's elog() function to convert elog(ERROR) into Perl croak(),
rather than longjmp'ing clear out of Perl and thereby leaving Perl in
a broken state. Also some minor prettification of error messages.
Still need to do something with spi_exec_query() error handling.
Tom Lane [Sat, 20 Nov 2004 17:59:31 +0000 (17:59 +0000)]
Fix one more place where we were expecting lcons() to be nondestructive
to the original List; per report from Sebastian BÎck. I think this is
the last such bug --- I examined every lcons() call in the backend and
the rest seem OK --- but it's nervous-making that we're still finding
'em so many months after the List rewrite went in.
Tom Lane [Sat, 20 Nov 2004 00:48:58 +0000 (00:48 +0000)]
Move pgstat_report_tabstat() call so that stats are not reported to the
collector until the transaction commits. Per recent discussion, this
should avoid confusing autovacuum when an updating transaction runs for
a long time.
Tom Lane [Sat, 20 Nov 2004 00:18:18 +0000 (00:18 +0000)]
Improve error reporting for SSL connection failures. Remove redundant
free operations in client_cert_cb --- openssl will also attempt to free
these structures, resulting in core dumps.
Tom Lane [Fri, 19 Nov 2004 23:22:54 +0000 (23:22 +0000)]
Fix incorrect documentation of plperl's method for accessing the number
of rows processed by a SPI query (David Fetter); also some other minor
editorial cleanup (Tom Lane).
Tom Lane [Fri, 19 Nov 2004 19:23:01 +0000 (19:23 +0000)]
Set rpath for plperl and plpython to ensure we can find the .so files
for the languages even when not installed in a standard directory.
pltcl may need this treatment as well, but we don't have the right path
conveniently available, so I'll leave it alone as long as there aren't
actual reports of trouble.
Tom Lane [Fri, 19 Nov 2004 00:41:39 +0000 (00:41 +0000)]
Modify the platform-specific makefiles so that macro 'rpath' is defined
in terms of macro 'rpathdir', as I proposed a few weeks ago. In itself
this commit shouldn't change the behavior at all, but it opens the door
to using special rpaths for the PL shared libraries, as seems to be
needed for plperl in particular.
Tom Lane [Thu, 18 Nov 2004 21:35:42 +0000 (21:35 +0000)]
Fix memory clobber problem reported by John Hansen: plperl_safe_init()
may expand the Perl stack, therefore we must SPAGAIN to reload the local
stack pointer after calling it. Also a couple other marginal readability
improvements.
Tom Lane [Thu, 18 Nov 2004 01:14:26 +0000 (01:14 +0000)]
Force pg_database updates out to disk immediately after ALTER DATABASE;
this is to avoid scenarios where incoming backends find no live copies
of a database's row because the only live copy is in an as-yet-unwritten
shared buffer, which they can't see. Also, use FlushRelationBuffers()
for forcing out pg_database, instead of the much more expensive BufferSync().
There's no need to write out pages belonging to other relations.
Tom Lane [Wed, 17 Nov 2004 21:23:36 +0000 (21:23 +0000)]
Remove ill-considered suppression of gcc warnings in plperl, and fix
some of the bugs exposed thereby. The remaining 'might be used uninitialized'
warnings look like live bugs, but I am not familiar enough with Perl/C hacking
to tell how to fix them.
Neil Conway [Wed, 17 Nov 2004 03:13:38 +0000 (03:13 +0000)]
Micro-optimization of markpos() and restrpos() in btree and hash indexes.
Rather than using ReadBuffer() to increment the reference count on an
already-pinned buffer, we should use IncrBufferRefCount() as it is
faster and does not require acquiring the BufMgrLock.
Tom Lane [Wed, 17 Nov 2004 00:14:14 +0000 (00:14 +0000)]
Fix Win32 problems with signals and sockets, by making the forkexec code
even uglier than it was already :-(. Also, on Windows only, use temporary
shared memory segments instead of ordinary files to pass over critical
variable values from postmaster to child processes. Magnus Hagander
Neil Conway [Tue, 16 Nov 2004 23:34:26 +0000 (23:34 +0000)]
Prevent a backend crash when processing CREATE TABLE commands with
more than 65K columns, or when the created table has more than 65K columns
due to adding inherited columns from parent relations. Fix a similar
crash when processing SELECT queries with more than 65K target list
entries. In all three cases we would eventually detect the error and
elog, but the check was being made too late.
Tom Lane [Tue, 16 Nov 2004 18:10:16 +0000 (18:10 +0000)]
Rethink plpgsql's way of handling SPI execution during an exception block.
We don't really want to start a new SPI connection, just keep using the old
one; otherwise we have memory management problems as illustrated by
John Kennedy's bug report of today. This requires a bit of a hack to
ensure the SPI stack state is properly restored, but then again what we
were doing before was a hack too, strictly speaking. Add a regression
test to cover this case.
Tom Lane [Sun, 14 Nov 2004 19:35:35 +0000 (19:35 +0000)]
Remove GUC USERLIMIT variable category, making the affected variables
plain SUSET instead. Also delay processing of options received in
client connection request until after we know if the user is a superuser,
so that SUSET values can be set that way by legitimate superusers.
Per recent discussion.
Neil Conway [Sun, 14 Nov 2004 02:04:14 +0000 (02:04 +0000)]
There is no need for ReadBuffer() call sites to check that the returned
buffer is valid, as ReadBuffer() will elog on error. Most of the call
sites of ReadBuffer() got this right, but this patch fixes those call
sites that did not.
Bruce Momjian [Sat, 13 Nov 2004 03:18:50 +0000 (03:18 +0000)]
Not entirely sure when this broke, but libpq's VC++ build is currently
lacking pqsignal which is now required. This was found and fixed for
VC++ by Shachar Shemesh, I simply duplicated the fix for the Borland
makefile (untested, as I don't have that compiler).
Bruce Momjian [Fri, 12 Nov 2004 23:26:37 +0000 (23:26 +0000)]
Update:
< * Eliminate WAL logging for CREATE INDEX/REINDEX/CREATE TABLE AS when
< not doing WAL archiving
> * Eliminate WAL logging for CREATE TABLE AS when not doing WAL archiving
Tom Lane [Fri, 12 Nov 2004 21:55:01 +0000 (21:55 +0000)]
Remove now-redundant description of Postgres file layout, in favor of
referencing the Database File Layout chapter I just added to the main
documentation.