]> granicus.if.org Git - postgresql/log
postgresql
16 years agoMention actual function names in documentation of how to pass binary
Bruce Momjian [Fri, 27 Jun 2008 02:44:31 +0000 (02:44 +0000)]
Mention actual function names in documentation of how to pass binary
values to libpq.

16 years agoAdd to TODO:
Bruce Momjian [Fri, 27 Jun 2008 02:38:29 +0000 (02:38 +0000)]
Add to TODO:

>
> * Fix system views like pg_stat_all_tables to use set-returning
>   functions, rather than views of per-column functions

16 years agoClarify plpgsql documentation by not treating IF THEN ELSE IF ... as a
Tom Lane [Fri, 27 Jun 2008 01:52:59 +0000 (01:52 +0000)]
Clarify plpgsql documentation by not treating IF THEN ELSE IF ... as a
truly distinct version of IF.  Per suggestion from Marko Kreen.

16 years agoModify the recently-added probe for -Wl,--as-needed some more, because RHEL-4
Tom Lane [Fri, 27 Jun 2008 00:36:16 +0000 (00:36 +0000)]
Modify the recently-added probe for -Wl,--as-needed some more, because RHEL-4
vintage Linux is even more broken than we realized: a link to libreadline
will succeed, and fail only at runtime.  It seems that an AC_TRY_RUN test
is the only reliable way to check whether this is really safe.  Per report
from Tatsuo.

16 years agoUse SGML table to show backslash string escapes, rather than have them
Bruce Momjian [Thu, 26 Jun 2008 22:24:42 +0000 (22:24 +0000)]
Use SGML table to show backslash string escapes, rather than have them
appear in a paragraph.

Andy Anderson

16 years agoAdd MERGE TODO URL:
Bruce Momjian [Thu, 26 Jun 2008 19:18:37 +0000 (19:18 +0000)]
Add MERGE TODO URL:

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

16 years agoFix pg_ctl bug where detection of binary location from postmaster.opts
Bruce Momjian [Thu, 26 Jun 2008 18:25:24 +0000 (18:25 +0000)]
Fix pg_ctl bug where detection of binary location from postmaster.opts
wasn't working.

16 years agoFix bug "select lower('asd') = 'asd'" returns false with multibyte encoding
Teodor Sigaev [Thu, 26 Jun 2008 16:06:37 +0000 (16:06 +0000)]
Fix bug "select lower('asd') = 'asd'" returns false with multibyte encoding
and non-C locale. Fix is just to use correct source's length for char2wchar
call.

16 years agoSynced parser
Michael Meskes [Thu, 26 Jun 2008 08:04:05 +0000 (08:04 +0000)]
Synced parser

16 years agoAdd TODO about security:
Bruce Momjian [Thu, 26 Jun 2008 03:58:00 +0000 (03:58 +0000)]
Add TODO about security:

* Improve server security options

  http://archives.postgresql.org/pgsql-hackers/2008-04/msg01875.php
  http://archives.postgresql.org/pgsql-hackers/2008-05/msg00000.php

16 years agoMore FAQ URL updates from Curtis Gallant.
Bruce Momjian [Thu, 26 Jun 2008 03:54:28 +0000 (03:54 +0000)]
More FAQ URL updates from Curtis Gallant.

16 years agoSimplify 'pg_ctl restart' detection of first argument in
Bruce Momjian [Thu, 26 Jun 2008 03:51:56 +0000 (03:51 +0000)]
Simplify 'pg_ctl restart' detection of first argument in
postmaster.opts.

16 years agoUpdate FAQ URLs as suggested by Curtis Gallant.
Bruce Momjian [Thu, 26 Jun 2008 03:02:27 +0000 (03:02 +0000)]
Update FAQ URLs as suggested by Curtis Gallant.

16 years agoAdd to TODO:
Bruce Momjian [Thu, 26 Jun 2008 02:53:19 +0000 (02:53 +0000)]
Add to TODO:

>
> * Improve LDAP authentication configuration options
>
>   http://archives.postgresql.org/pgsql-hackers/2008-04/msg01745.php

16 years agoFix 'pg_ctl restart' to preserve command-line arguments.
Bruce Momjian [Thu, 26 Jun 2008 02:47:19 +0000 (02:47 +0000)]
Fix 'pg_ctl restart' to preserve command-line arguments.

16 years agoUse SYSTEMQUOTE as concatentation to strings, rather than %s printf
Bruce Momjian [Thu, 26 Jun 2008 01:35:45 +0000 (01:35 +0000)]
Use SYSTEMQUOTE as concatentation to strings, rather than %s printf
patterns, for clarity.

16 years agoRemove use of postmaster.opts.default by pg_ctl.
Bruce Momjian [Thu, 26 Jun 2008 01:12:20 +0000 (01:12 +0000)]
Remove use of postmaster.opts.default by pg_ctl.

16 years agoReduce the alignment requirement of type "name" from int to char, and arrange
Tom Lane [Tue, 24 Jun 2008 17:58:27 +0000 (17:58 +0000)]
Reduce the alignment requirement of type "name" from int to char, and arrange
to suppress zero-padding of "name" entries in indexes.

The alignment change is unlikely to save any space, but it is really needed
anyway to make the world safe for our widespread practice of passing plain
old C strings to functions that are declared as taking Name.  In the previous
coding, the C compiler was entitled to assume that a Name pointer was
word-aligned; but we were failing to guarantee that.  I think the reason
we'd not seen failures is that usually the only thing that gets done with
such a pointer is strcmp(), which is hard to optimize in a way that exploits
word-alignment.  Still, some enterprising compiler guy will probably think
of a way eventually, or we might change our code in a way that exposes
more-obvious optimization opportunities.

The padding change is accomplished in one-liner fashion by declaring the
"name" index opclasses to use storage type "cstring" in pg_opclass.h.
Normally btree and hash don't allow a nondefault storage type, because they
don't have any provisions for converting the input datum to another type.
However, because name and cstring are effectively the same thing except for
padding, no conversion is needed --- we only need index_form_tuple() to treat
the datum as being cstring not name, and this is sufficient.  This seems to
make for about a one-third reduction in the typical sizes of system catalog
indexes that involve "name" columns, of which we have many.

These two changes are only weakly related, but the alignment change makes
me feel safer that the padding change won't introduce problems, so I'm
committing them together.

16 years agoTODO item done:
Bruce Momjian [Tue, 24 Jun 2008 15:53:24 +0000 (15:53 +0000)]
TODO item done:

<  o Prevent pg_dump/pg_restore from being affected by
>  o -Prevent pg_dump/pg_restore from being affected by

16 years agoOops, make the MSVC build put fmgroids.h where it needs to be.
Tom Lane [Tue, 24 Jun 2008 01:15:36 +0000 (01:15 +0000)]
Oops, make the MSVC build put fmgroids.h where it needs to be.
Per buildfarm results.

16 years agoAdd TODO:
Bruce Momjian [Mon, 23 Jun 2008 22:42:32 +0000 (22:42 +0000)]
Add TODO:

>
>  o Allow COPY to report errors sooner
>
>          http://archives.postgresql.org/pgsql-hackers/2008-04/msg01169.php

16 years agoAdd URL for Merge.
Bruce Momjian [Mon, 23 Jun 2008 22:23:54 +0000 (22:23 +0000)]
Add URL for Merge.

16 years agoBackup wording improvement.
Bruce Momjian [Mon, 23 Jun 2008 22:15:17 +0000 (22:15 +0000)]
Backup wording improvement.

Joshua D. Drake

16 years agoAdd to TODO:
Bruce Momjian [Mon, 23 Jun 2008 22:12:20 +0000 (22:12 +0000)]
Add to TODO:

> * Allow custom variables to appear in pg_settings()

16 years agoAdd item:
Bruce Momjian [Mon, 23 Jun 2008 21:35:35 +0000 (21:35 +0000)]
Add item:

* Implement a module capability for loading /contrib-style extensions

  http://archives.postgresql.org/pgsql-patches/2008-04/msg00164.php

16 years agoAdd libpq comment about how to determine the format used for passing
Bruce Momjian [Mon, 23 Jun 2008 21:10:49 +0000 (21:10 +0000)]
Add libpq comment about how to determine the format used for passing
binary values.

Add comments to libpq C function for parameter passing.

16 years agoAdd TODO:
Bruce Momjian [Mon, 23 Jun 2008 20:20:54 +0000 (20:20 +0000)]
Add TODO:

* Consider whether duplicate keys should be sorted by block/offset

  http://archives.postgresql.org/pgsql-hackers/2008-03/msg00558.php

Create new "Sorting" TODO section.

16 years agoMerge duplicate upper/lower/initcap() routines in oracle_compat.c and
Bruce Momjian [Mon, 23 Jun 2008 19:27:19 +0000 (19:27 +0000)]
Merge duplicate upper/lower/initcap() routines in oracle_compat.c and
formatting.c to use common code;  remove duplicate functions and support
routines that are no longer needed.

16 years agoFix Gen_fmgrtab.sh to not rely on hard-wired knowledge of the column numbers
Tom Lane [Mon, 23 Jun 2008 17:54:30 +0000 (17:54 +0000)]
Fix Gen_fmgrtab.sh to not rely on hard-wired knowledge of the column numbers
in pg_proc.  Also make it not emit duplicate extern declarations, and make it
a bit more bulletproof in some other small ways.  Likewise fix the equally
hard-wired, and utterly undocumented, knowledge in the MSVC build scripts.
For testing purposes and perhaps other uses in future, pull out that portion
of the MSVC scripts into a standalone perl script equivalent to
Gen_fmgrtab.sh, and make it generate actually identical output, rather than
just more-or-less-the-same output.

Motivated by looking at Pavel's variadic function patch.  Whether or not
that gets accepted, we can be sure that pg_proc's column set will change
again in the future; it's time to not have to deal with this gotcha.

16 years agoSeems I was too optimistic in supposing that sinval's maxMsgNum could be
Tom Lane [Fri, 20 Jun 2008 00:24:53 +0000 (00:24 +0000)]
Seems I was too optimistic in supposing that sinval's maxMsgNum could be
read and written without a lock.  The value itself is atomic, sure, but on
processors with weak memory ordering it's possible for a reader to see the
value change before it sees the associated message written into the buffer
array.  Fix by introducing a spinlock that's used just to read and write
maxMsgNum.  (We could do this with less overhead if we recognized a concept
of "memory access barrier"; is it worth introducing such a thing?  At the
moment probably not --- I can't measure any clear slowdown from adding the
spinlock, so this solution is probably fine.)  Per buildfarm results.

16 years agoRewrite the sinval messaging mechanism to reduce contention and avoid
Tom Lane [Thu, 19 Jun 2008 21:32:56 +0000 (21:32 +0000)]
Rewrite the sinval messaging mechanism to reduce contention and avoid
unnecessary cache resets.  The major changes are:

* When the queue overflows, we only issue a cache reset to the specific
backend or backends that still haven't read the oldest message, rather
than resetting everyone as in the original coding.

* When we observe backend(s) falling well behind, we signal SIGUSR1
to only one backend, the one that is furthest behind and doesn't already
have a signal outstanding for it.  When it finishes catching up, it will
in turn signal SIGUSR1 to the next-furthest-back guy, if there is one that
is far enough behind to justify a signal.  The PMSIGNAL_WAKEN_CHILDREN
mechanism is removed.

* We don't attempt to clean out dead messages after every message-receipt
operation; rather, we do it on the insertion side, and only when the queue
fullness passes certain thresholds.

* Split SInvalLock into SInvalReadLock and SInvalWriteLock so that readers
don't block writers nor vice versa (except during the infrequent queue
cleanout operations).

* Transfer multiple sinval messages for each acquisition of a read or
write lock.

16 years agoFix a few places that were non-multibyte-safe in tsearch configuration file
Tom Lane [Thu, 19 Jun 2008 16:52:24 +0000 (16:52 +0000)]
Fix a few places that were non-multibyte-safe in tsearch configuration file
parsing.  Per bug #4253 from Giorgio Valoti.

16 years agoAdd URL for:
Bruce Momjian [Thu, 19 Jun 2008 01:15:48 +0000 (01:15 +0000)]
Add URL for:

        o Allow pg_hba.conf to specify host names along with IP addresses
>    http://archives.postgresql.org/pgsql-hackers/2008-06/msg00569.php

16 years agoImprove our #include situation by moving pointer types away from the
Alvaro Herrera [Thu, 19 Jun 2008 00:46:06 +0000 (00:46 +0000)]
Improve our #include situation by moving pointer types away from the
corresponding struct definitions.  This allows other headers to avoid including
certain highly-loaded headers such as rel.h and relscan.h, instead using just
relcache.h, heapam.h or genam.h, which are more lightweight and thus cause less
unnecessary dependencies.

16 years agoFix compiler warning introduced by recent patch. Tsk tsk.
Tom Lane [Wed, 18 Jun 2008 23:08:47 +0000 (23:08 +0000)]
Fix compiler warning introduced by recent patch.  Tsk tsk.

16 years agoImprove error reporting for problems in text search configuration files
Tom Lane [Wed, 18 Jun 2008 20:55:42 +0000 (20:55 +0000)]
Improve error reporting for problems in text search configuration files
by installing an error context subroutine that will provide the file name
and line number for all errors detected while reading a config file.
Some of the reader routines were already doing that in an ad-hoc way for
errors detected directly in the reader, but it didn't help for problems
detected in subroutines, such as encoding violations.

Back-patch to 8.3 because 8.3 is where people will be trying to debug
configuration files.

16 years agoMove wchar2char() and char2wchar() from tsearch into /mb to be easier to
Bruce Momjian [Wed, 18 Jun 2008 18:42:54 +0000 (18:42 +0000)]
Move wchar2char() and char2wchar() from tsearch into /mb to be easier to
use for other modules;  also move pnstrdup().

Clean up code slightly.

16 years agoFix a few typos in the DTrace docs. Patch from Euler Taveira de Oliveira,
Neil Conway [Wed, 18 Jun 2008 17:44:12 +0000 (17:44 +0000)]
Fix a few typos in the DTrace docs. Patch from Euler Taveira de Oliveira,
along with an additional typo I noticed along the way.

16 years agoRemove freeBackends counter from the sinval shared memory area. We used to
Tom Lane [Tue, 17 Jun 2008 20:07:08 +0000 (20:07 +0000)]
Remove freeBackends counter from the sinval shared memory area.  We used to
use it to help enforce superuser_reserved_backends, but since 8.1 it's
just been dead weight.

16 years agoClean up some problems with redundant cross-type arithmetic operators. Add
Tom Lane [Tue, 17 Jun 2008 19:10:56 +0000 (19:10 +0000)]
Clean up some problems with redundant cross-type arithmetic operators.  Add
int2-and-int8 implementations of the basic arithmetic operators +, -, *, /.
This doesn't really add any new functionality, but it avoids "operator is not
unique" failures that formerly occurred in these cases because the parser
couldn't decide whether to promote the int2 to int4 or int8.  We could
alternatively have removed the existing cross-type operators, but
experimentation shows that the cost of an additional type coercion expression
node is noticeable compared to such cheap operators; so let's not give up any
performance here.  On the other hand, I removed the int2-and-int4 modulo (%)
operators since they didn't seem as important from a performance standpoint.
Per a complaint last January from ykhuang.

16 years agoAdd URL for introduction to multibyte programming in C.
Bruce Momjian [Tue, 17 Jun 2008 18:22:43 +0000 (18:22 +0000)]
Add URL for introduction to multibyte programming in C.

16 years agoMove USE_WIDE_UPPER_LOWER define to c.h, and remove TS_USE_WIDE and use
Bruce Momjian [Tue, 17 Jun 2008 16:09:06 +0000 (16:09 +0000)]
Move USE_WIDE_UPPER_LOWER define to c.h, and remove TS_USE_WIDE and use
USE_WIDE_UPPER_LOWER instead.

16 years agoFix the code that adds regclass constants to a plan's list of relation OIDs
Tom Lane [Tue, 17 Jun 2008 14:51:32 +0000 (14:51 +0000)]
Fix the code that adds regclass constants to a plan's list of relation OIDs
that it depends on for replan-forcing purposes.  We need to consider plain OID
constants too, because eval_const_expressions folds a RelabelType atop a Const
to just a Const.  This change could result in OID values that aren't really
for tables getting added to the dependency list, but the worst-case
consequence would be occasional useless replans.  Per report from Gabriele
Messineo.

16 years agoClean up a number of bogosities around pltcl's handling of the Tcl "result":
Tom Lane [Tue, 17 Jun 2008 00:52:43 +0000 (00:52 +0000)]
Clean up a number of bogosities around pltcl's handling of the Tcl "result":

1. Directly reading interp->result is deprecated in Tcl 8.0 and later;
you're supposed to use Tcl_GetStringResult.  This code finally broke with
Tcl 8.5, because Tcl_GetVar can now have side-effects on interp->result even
though it preserves the logical state of the result.  (There's arguably a
Tcl issue here, because Tcl_GetVar could invalidate the pointer result of a
just-preceding Tcl_GetStringResult, but I doubt the Tcl guys will see it as
a bug.)

2. We were being sloppy about the encoding of the result: some places would
push database-encoding data into the Tcl result, which should not happen,
and we were assuming that any error result coming back from Tcl was in the
database encoding, which is not a good assumption.

3. There were a lot of calls of Tcl_SetResult that uselessly specified
TCL_VOLATILE for constant strings.  This is only a minor performance issue,
but I fixed it in passing since I had to look at all the calls anyway.

#2 is a live bug regardless of which Tcl version you are interested in,
so back-patch even to branches that are unlikely to be used with Tcl 8.5.
I went back as far as 8.0, which is as far as the patch applied easily;
7.4 was using a different error processing scheme that has got its own
problems :-(

16 years agoRewrite docs section about routine vacuuming --- it's gotten rather mangled of
Tom Lane [Mon, 16 Jun 2008 03:13:14 +0000 (03:13 +0000)]
Rewrite docs section about routine vacuuming --- it's gotten rather mangled of
late, with lots of redundancy, bad grammar, and just plain poor exposition.
Make it clear that autovacuum is now considered the normal solution.

16 years agoPrevent CVS from mangling script
Andrew Dunstan [Sun, 15 Jun 2008 21:58:55 +0000 (21:58 +0000)]
Prevent CVS from mangling script

16 years agoAdd script to find .c and .h files that are missing CVS PostgreSQL markers
Andrew Dunstan [Sun, 15 Jun 2008 21:46:02 +0000 (21:46 +0000)]
Add script to find .c and .h files that are missing CVS PostgreSQL markers
and add them. Avoids third party files or those that would cause regression
failures.

16 years agoMake DROP INDEX lock the parent table before locking the index. This behavior
Tom Lane [Sun, 15 Jun 2008 16:29:05 +0000 (16:29 +0000)]
Make DROP INDEX lock the parent table before locking the index.  This behavior
is necessary to avoid deadlock against ordinary queries, but we'd broken it
with recent changes that made the DROP machinery lock the index before
arriving at index_drop.  Per intermittent buildfarm failures.

16 years agoFix 64-bit problem in recent patch.
Tom Lane [Sun, 15 Jun 2008 01:41:37 +0000 (01:41 +0000)]
Fix 64-bit problem in recent patch.

16 years agoRearrange ALTER TABLE syntax processing as per my recent proposal: the
Tom Lane [Sun, 15 Jun 2008 01:25:54 +0000 (01:25 +0000)]
Rearrange ALTER TABLE syntax processing as per my recent proposal: the
grammar allows ALTER TABLE/INDEX/SEQUENCE/VIEW interchangeably for all
subforms of those commands, and then we sort out what's really legal
at execution time.  This allows the ALTER SEQUENCE/VIEW reference pages
to fully document all the ALTER forms available for sequences and views
respectively, and eliminates a longstanding cause of confusion for users.

The net effect is that the following forms are allowed that weren't before:
ALTER SEQUENCE OWNER TO
ALTER VIEW ALTER COLUMN SET/DROP DEFAULT
ALTER VIEW OWNER TO
ALTER VIEW SET SCHEMA
(There's no actual functionality gain here, but formerly you had to say
ALTER TABLE instead.)

Interestingly, the grammar tables actually get smaller, probably because
there are fewer special cases to keep track of.

I did not disallow using ALTER TABLE for these operations.  Perhaps we
should, but there's a backwards-compatibility issue if we do; in fact
it would break existing pg_dump scripts.  I did however tighten up
ALTER SEQUENCE and ALTER VIEW to reject non-sequences and non-views
in the new cases as well as a couple of cases where they didn't before.

The patch doesn't change pg_dump to use the new syntaxes, either.

16 years agoIn log_filename documentation, mention that strftime is not used directly to
Alvaro Herrera [Sat, 14 Jun 2008 21:59:59 +0000 (21:59 +0000)]
In log_filename documentation, mention that strftime is not used directly to
expand the pattern specifier.

Per gripe from Josh Drake.

16 years agoRefactor the handling of the various DropStmt variants so that when multiple
Tom Lane [Sat, 14 Jun 2008 18:04:34 +0000 (18:04 +0000)]
Refactor the handling of the various DropStmt variants so that when multiple
objects are specified, we drop them all in a single performMultipleDeletions
call.  This makes the RESTRICT/CASCADE checks more relaxed: it's not counted
as a cascade if one of the later objects has a dependency on an earlier one.
NOTICE messages about such cases go away, too.

In passing, fix the permissions check for DROP CONVERSION, which for some
reason was never made role-aware, and omitted the namespace-owner exemption
too.

Alex Hunsaker, with further fiddling by me.

16 years agoModify TODO entry to be a function:
Bruce Momjian [Fri, 13 Jun 2008 16:24:38 +0000 (16:24 +0000)]
Modify TODO entry to be a function:

>  o Add functions to syntax check configuration files
>
< * Add pg_ctl option to do a syntax check of postgresql.conf

16 years agoImprove the various elog messages in tuptoaster.c to report which TOAST table
Tom Lane [Fri, 13 Jun 2008 02:59:47 +0000 (02:59 +0000)]
Improve the various elog messages in tuptoaster.c to report which TOAST table
the problem happened in.  These are all supposedly can't-happen cases, but
when they do happen it's useful to know where.

Back-patch to 8.3, but not further because the patch doesn't apply cleanly
further back.  Given the lack of response to my proposal of this, there
doesn't seem to be enough interest to justify much back-porting effort.

16 years agoUse macro to document size of ecpg sqlerrmc string.
Bruce Momjian [Thu, 12 Jun 2008 19:15:40 +0000 (19:15 +0000)]
Use macro to document size of ecpg sqlerrmc string.

16 years agoUpdate item to mention target list problem:
Bruce Momjian [Thu, 12 Jun 2008 18:09:04 +0000 (18:09 +0000)]
Update item to mention target list problem:

< * Allow INSERT/UPDATE ... RETURNING inside a SELECT 'FROM' clause
> * Allow INSERT/UPDATE ... RETURNING inside a SELECT 'FROM' clause or
>   target list
>   http://archives.postgresql.org/pgsql-hackers/2008-06/msg00124.php

16 years agoRefactor XLogOpenRelation() and XLogReadBuffer() in preparation for relation
Heikki Linnakangas [Thu, 12 Jun 2008 09:12:31 +0000 (09:12 +0000)]
Refactor XLogOpenRelation() and XLogReadBuffer() in preparation for relation
forks. XLogOpenRelation() and the associated light-weight relation cache in
xlogutils.c is gone, and XLogReadBuffer() now takes a RelFileNode as argument,
instead of Relation.

For functions that still need a Relation struct during WAL replay, there's a
new function called CreateFakeRelcacheEntry() that returns a fake entry like
XLogOpenRelation() used to.

16 years agoImprove reporting of dependencies in DROP to work like the scheme that we
Tom Lane [Wed, 11 Jun 2008 21:53:49 +0000 (21:53 +0000)]
Improve reporting of dependencies in DROP to work like the scheme that we
devised for pg_shdepend, namely the individual dependencies are reported as
DETAIL lines rather than coming out as separate NOTICEs.  The client-side
report is capped at 100 lines, but the server log always gets a full report.

16 years agoAdd:
Bruce Momjian [Wed, 11 Jun 2008 20:54:31 +0000 (20:54 +0000)]
Add:

> * Add pg_ctl option to do a syntax check of postgresql.conf

16 years agoFix spelling mistake in postgresql.conf.
Bruce Momjian [Wed, 11 Jun 2008 15:44:52 +0000 (15:44 +0000)]
Fix spelling mistake in postgresql.conf.

Greg Sabino Mullane

16 years agoUpdate "help" output to reflect that \timing now takes an optional on/off
Heikki Linnakangas [Wed, 11 Jun 2008 10:55:43 +0000 (10:55 +0000)]
Update "help" output to reflect that \timing now takes an optional on/off
argument.

16 years agoAdd optional on/off argument to \timing.
Heikki Linnakangas [Wed, 11 Jun 2008 10:48:17 +0000 (10:48 +0000)]
Add optional on/off argument to \timing.

David Fetter.

16 years agoFix bug in the WAL recovery code to finish an incomplete split.
Heikki Linnakangas [Wed, 11 Jun 2008 08:38:56 +0000 (08:38 +0000)]
Fix bug in the WAL recovery code to finish an incomplete split.
CacheInvalidateRelcache() crashes if called in WAL recovery, because the
invalidation infrastructure hasn't been initialized yet.

Back-patch to 8.2, where the bug was introduced.

16 years agoEditorialization for the text emitted by the "help" psql command.
Neil Conway [Tue, 10 Jun 2008 20:58:19 +0000 (20:58 +0000)]
Editorialization for the text emitted by the "help" psql command.
Basically just reuse the same text that psql emitted as part of
its startup banner in prior versions, and make some whitespace
more consistent with the conventions in other psql command output.

16 years agoCreate a script to handle stamping release version numbers into files,
Tom Lane [Tue, 10 Jun 2008 18:08:48 +0000 (18:08 +0000)]
Create a script to handle stamping release version numbers into files,
replacing the tedious and error-prone manual process we've been using.

16 years agoComment fix, should say TSQuery instead of TSVector.
Heikki Linnakangas [Tue, 10 Jun 2008 08:55:50 +0000 (08:55 +0000)]
Comment fix, should say TSQuery instead of TSVector.

Per Jan Urbanski.

16 years agoMake XML building work silently on VPATH builds (untested on regular builds).
Alvaro Herrera [Tue, 10 Jun 2008 00:19:32 +0000 (00:19 +0000)]
Make XML building work silently on VPATH builds (untested on regular builds).

16 years agoFix unportable (and incorrect anyway) usage of LL constant suffix that
Tom Lane [Mon, 9 Jun 2008 19:58:39 +0000 (19:58 +0000)]
Fix unportable (and incorrect anyway) usage of LL constant suffix that
recently snuck into cash.c.  Per report from Edmundo Robles Lopez.

16 years agoUpdate Japanese FAQ.
Bruce Momjian [Mon, 9 Jun 2008 19:37:16 +0000 (19:37 +0000)]
Update Japanese FAQ.

Jun Kuwamura

16 years agoFix datetime input functions to correctly detect integer overflow when
Tom Lane [Mon, 9 Jun 2008 19:34:02 +0000 (19:34 +0000)]
Fix datetime input functions to correctly detect integer overflow when
running on a 64-bit platform ... strtol() will happily return 64-bit
output in that case.  Per bug #4231 from Geoff Tolley.

16 years agoFix an ALTER TABLE test case so that it actually tests what the comment says it
Tom Lane [Mon, 9 Jun 2008 18:28:00 +0000 (18:28 +0000)]
Fix an ALTER TABLE test case so that it actually tests what the comment says it
is testing.  Ah, the perils of making keywords optional ...

16 years agoFurther tweak for comment in CheckDeadLock(), per Tom.
Neil Conway [Mon, 9 Jun 2008 18:23:05 +0000 (18:23 +0000)]
Further tweak for comment in CheckDeadLock(), per Tom.

16 years agoFix typo in comment.
Neil Conway [Mon, 9 Jun 2008 06:55:34 +0000 (06:55 +0000)]
Fix typo in comment.

16 years agoFix breakage caused by conflicting patches, as evidenced by the buildfarm.
Alvaro Herrera [Sun, 8 Jun 2008 23:16:43 +0000 (23:16 +0000)]
Fix breakage caused by conflicting patches, as evidenced by the buildfarm.

16 years agoRewrite DROP's dependency traversal algorithm into an honest two-pass
Tom Lane [Sun, 8 Jun 2008 22:41:04 +0000 (22:41 +0000)]
Rewrite DROP's dependency traversal algorithm into an honest two-pass
algorithm, replacing the original intention of a one-pass search, which
had been hacked up over time to be partially two-pass in hopes of handling
various corner cases better.  It still wasn't quite there, especially as
regards emitting unwanted NOTICE messages.  More importantly, this approach
lets us fix a number of open bugs concerning concurrent DROP scenarios,
because we can take locks during the first pass and avoid traversing to
dependent objects that were just deleted by someone else.

There is more that can be done here, but I'll go ahead and commit the
base patch before working on the options.

16 years agoMove BufferGetPageSize and BufferGetPage from bufpage.h to bufmgr.h. It is
Alvaro Herrera [Sun, 8 Jun 2008 22:00:48 +0000 (22:00 +0000)]
Move BufferGetPageSize and BufferGetPage from bufpage.h to bufmgr.h.  It is
more logical that way, and also it reduces the amount of unnecessary includes
in bufpage.h, which is widely used.

Zdenek Kotala.

My previous patch to bufpage.h should also have credited him as author, but I
forgot (sorry about that).

16 years agoUpdate release notes for ALTER AGGREGATE fix.
Tom Lane [Sun, 8 Jun 2008 21:46:07 +0000 (21:46 +0000)]
Update release notes for ALTER AGGREGATE fix.

16 years agoALTER AGGREGATE OWNER seems to have been missed by the last couple of
Tom Lane [Sun, 8 Jun 2008 21:09:48 +0000 (21:09 +0000)]
ALTER AGGREGATE OWNER seems to have been missed by the last couple of
patches that dealt with object ownership.  It wasn't updating pg_shdepend
nor adjusting the aggregate's ACL.  In 8.2 and up, fix this permanently
by making it use AlterFunctionOwner_oid.  In 8.1, the function code wasn't
factored that way, so just copy and paste.

16 years agoUpdate release notes for 8.3.3 et al.
Tom Lane [Sat, 7 Jun 2008 22:10:38 +0000 (22:10 +0000)]
Update release notes for 8.3.3 et al.

16 years agoChange xlog.h to xlogdefs.h in bufpage.h, and fix fallout.
Alvaro Herrera [Fri, 6 Jun 2008 22:35:22 +0000 (22:35 +0000)]
Change xlog.h to xlogdefs.h in bufpage.h, and fix fallout.

16 years agoFix pg_get_ruledef() so that negative numeric constants are parenthesized.
Tom Lane [Fri, 6 Jun 2008 17:59:29 +0000 (17:59 +0000)]
Fix pg_get_ruledef() so that negative numeric constants are parenthesized.
This is needed because :: casting binds more tightly than minus, so for
example -1::integer is not the same as (-1)::integer, and there are cases
where the difference is important.  In particular this caused a failure
in SELECT DISTINCT ... ORDER BY ... where expressions that should have
matched were seen as different by the parser; but I suspect that there
could be other cases where failure to parenthesize leads to subtler
semantic differences in reloaded rules.  Per report from Alexandr Popov.

16 years agoFix missing "not", per Frank Millman (bug #4212).
Alvaro Herrera [Thu, 5 Jun 2008 19:56:09 +0000 (19:56 +0000)]
Fix missing "not", per Frank Millman (bug #4212).

16 years agoModify vacuum() to accept a single relation OID instead of a list (which we
Alvaro Herrera [Thu, 5 Jun 2008 15:47:32 +0000 (15:47 +0000)]
Modify vacuum() to accept a single relation OID instead of a list (which we
always pass as a single element anyway.)  In passing, fix an outdated comment.

16 years agoFix some string building in getObjectDescription.
Alvaro Herrera [Thu, 5 Jun 2008 15:04:39 +0000 (15:04 +0000)]
Fix some string building in getObjectDescription.

16 years agoAdded lost sysmbol SQL_SQL to list of allowed variable names.
Michael Meskes [Wed, 4 Jun 2008 12:23:34 +0000 (12:23 +0000)]
Added lost sysmbol SQL_SQL to list of allowed variable names.

16 years agoDraft release notes for upcoming back-branch updates.
Tom Lane [Wed, 4 Jun 2008 03:16:02 +0000 (03:16 +0000)]
Draft release notes for upcoming back-branch updates.

16 years agoFix initdb to reject a relative path for -X (--xlogdir) argument. This
Tom Lane [Mon, 2 Jun 2008 03:48:00 +0000 (03:48 +0000)]
Fix initdb to reject a relative path for -X (--xlogdir) argument.  This
doesn't work, and the real reason why not is it's unclear where the path
is relative to (initdb's CWD, or the data directory?).  We could make an
arbitrary decision, but it seems best to make the user be unambiguous.
Per gripe from Devrim.

16 years agoUpdate time zone data files to tzdata release 2008c (DST law changes in
Tom Lane [Sun, 1 Jun 2008 18:23:00 +0000 (18:23 +0000)]
Update time zone data files to tzdata release 2008c (DST law changes in
Morocco, Iraq, Choibalsan, Pakistan, Syria, Cuba, Argentina/San_Luis).

16 years agoRefactor SPI_cursor_open/SPI_cursor_open_with_args so that the latter sets
Tom Lane [Sun, 1 Jun 2008 17:32:48 +0000 (17:32 +0000)]
Refactor SPI_cursor_open/SPI_cursor_open_with_args so that the latter sets
the PARAM_FLAG_CONST flag on the parameters that are passed into the portal,
while the former's behavior is unchanged.  This should only affect the case
where the portal is executing an EXPLAIN; it will cause the generated plan to
look more like what would be generated if the portal were actually executing
the command being explained.  Per gripe from Pavel.

16 years agoMarginal improvements to the documentation for PGOPTIONS.
Tom Lane [Sun, 1 Jun 2008 16:23:08 +0000 (16:23 +0000)]
Marginal improvements to the documentation for PGOPTIONS.

16 years agoDone: -Remove psql newline patch when we find out why mingw outputs an extra newline
Andrew Dunstan [Sat, 31 May 2008 15:05:46 +0000 (15:05 +0000)]
Done:  -Remove psql newline patch when we find out why mingw outputs an extra newline

16 years agoCopy refint.so and autoinc.so into the src/test/regress directory during
Tom Lane [Fri, 30 May 2008 00:04:32 +0000 (00:04 +0000)]
Copy refint.so and autoinc.so into the src/test/regress directory during
"make all", and then reference them there during the actual tests.  This
makes the handling of these files more parallel to that of regress.so,
and in particular simplifies use of the regression tests outside the
original build tree.  The PGDG and Red Hat RPMs have been doing this via
patches for a very long time.  Inclusion of the change in core was requested
by Jørgen Austvik of Sun, and I can't see any reason not to.

I attempted to fix the MSVC scripts for this too, but they may need
further tweaking ...

16 years agoImprove the documentation comment for replace(). Robert Treat
Tom Lane [Thu, 29 May 2008 22:48:07 +0000 (22:48 +0000)]
Improve the documentation comment for replace().  Robert Treat

16 years agoTweak libpq to avoid crashing due to incorrect buffer size calculation when
Tom Lane [Thu, 29 May 2008 22:02:44 +0000 (22:02 +0000)]
Tweak libpq to avoid crashing due to incorrect buffer size calculation when
we are on a 64-bit machine (ie, size_t is wider than int) and someone passes
in a query string that approaches or exceeds INT_MAX bytes.  Also, just for
paranoia's sake, guard against similar overflows in sizing the input buffer.

The backend will not in the foreseeable future be prepared to send or receive
strings exceeding 1GB, so I didn't take the more invasive step of switching
all the buffer index variables from int to size_t; though someday we might
want to do that.

I have a suspicion that this is not the only such bug in libpq, but this
fix is enough to take care of the crash reported by Francisco Reyes.

16 years agoFix some bugs introduced by the 8.2-era conversion of cube functions to V1
Tom Lane [Thu, 29 May 2008 18:46:40 +0000 (18:46 +0000)]
Fix some bugs introduced by the 8.2-era conversion of cube functions to V1
calling convention.  cube_inter and cube_distance could attempt to pfree
their input arguments, and cube_dim returned a value from a struct it
might have just pfree'd (which would only really cause a problem in a
debug build, but it's still wrong).  Per bug #4208 and additional code
reading.

In HEAD and 8.3, I also made a batch of cosmetic changes to bring these
functions into line with the preferred coding style for V1 functions,
ie declare and fetch all the arguments at the top so readers can easily
see what they are.

16 years agoAdd description to:
Bruce Momjian [Thu, 29 May 2008 02:04:15 +0000 (02:04 +0000)]
Add description to:

* Add deferred trigger queue file

<   This item involves dumping large queues into files.
>   This item involves dumping large queues into files, or doing some
>   kind of join to process all the triggers, or some bulk operation.

16 years agoAdd URL for:
Bruce Momjian [Thu, 29 May 2008 01:58:29 +0000 (01:58 +0000)]
Add URL for:

* Add deferred trigger queue file

>   http://archives.postgresql.org/pgsql-hackers/2008-05/msg00876.php

16 years agoSet hidden field for guc enum missed in previous commit.
Magnus Hagander [Wed, 28 May 2008 15:22:05 +0000 (15:22 +0000)]
Set hidden field for guc enum missed in previous commit.

16 years agoAdd a field to guc enums to allow hiding of values from display while
Magnus Hagander [Wed, 28 May 2008 09:04:06 +0000 (09:04 +0000)]
Add a field to guc enums to allow hiding of values from display while
still accepting them as input, used to allow alternate syntax for the
same setting.

Alex Hunsaker

16 years agoImprove GRANT documentation to point out that UPDATE and DELETE typically
Tom Lane [Wed, 28 May 2008 00:45:40 +0000 (00:45 +0000)]
Improve GRANT documentation to point out that UPDATE and DELETE typically
require SELECT privilege as well, since you normally need to read existing
column values within such commands.  This behavior is according to spec,
but we'd never documented it before.  Per gripe from Volkan Yazici.