OSDN Git Service

pg-rex/syncrep.git
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.

16 years agoRequire bind_textdomain_codeset() not just gettext() to enable NLS support.
Tom Lane [Tue, 27 May 2008 22:18:04 +0000 (22:18 +0000)]
Require bind_textdomain_codeset() not just gettext() to enable NLS support.
GNU gettext before 0.10.36 does not have that function, and is generally too
incomplete to be usable.

16 years agoClarify description of typmod input function, per Jeff Davis.
Tom Lane [Tue, 27 May 2008 18:05:13 +0000 (18:05 +0000)]
Clarify description of typmod input function, per Jeff Davis.

16 years agoExplicitly bind gettext() to the UTF8 locale when in use.
Magnus Hagander [Tue, 27 May 2008 12:24:42 +0000 (12:24 +0000)]
Explicitly bind gettext() to the  UTF8 locale when in use.
This is required on Windows due to the special locale
handling for UTF8 that doesn't change the full environment.

Fixes crash with translated error messages per bugs 4180
and 4196.

Tom Lane

16 years agoAlter the xxx_pattern_ops opclasses to use the regular equality operator of
Tom Lane [Tue, 27 May 2008 00:13:09 +0000 (00:13 +0000)]
Alter the xxx_pattern_ops opclasses to use the regular equality operator of
the associated datatype as their equality member.  This means that these
opclasses can now support plain equality comparisons along with LIKE tests,
thus avoiding the need for an extra index in some applications.  This
optimization was not possible when the pattern opclasses were first introduced,
because we didn't insist that text equality meant bitwise equality; but we
do now, so there is no semantic difference between regular and pattern
equality operators.

I removed the name_pattern_ops opclass altogether, since it's really useless:
name's regular comparisons are just strcmp() and are unlikely to become
something different.  Instead teach indxpath.c that btree name_ops can be
used for LIKE whether or not the locale is C.  This might lead to a useful
speedup in LIKE queries on the system catalogs in non-C locales.

The ~=~ and ~<>~ operators are gone altogether.  (It would have been nice to
keep them for backward compatibility's sake, but since the pg_amop structure
doesn't allow multiple equality operators per opclass, there's no way.)

A not-immediately-obvious incompatibility is that the sort order within
bpchar_pattern_ops indexes changes --- it had been identical to plain
strcmp, but is now trailing-blank-insensitive.  This will impact
in-place upgrades, if those ever happen.

Per discussions a couple months ago.

16 years agoFix an old corner-case bug in set_config_option: push_old_value has to be
Tom Lane [Mon, 26 May 2008 18:54:29 +0000 (18:54 +0000)]
Fix an old corner-case bug in set_config_option: push_old_value has to be
called before, not after, calling the assign_hook if any.  This is because
push_old_value might fail (due to palloc out-of-memory), and in that case
there would be no stack entry to tell transaction abort to undo the GUC
assignment.  Of course the actual assignment to the GUC variable hasn't
happened yet --- but the assign_hook might have altered subsidiary state.
Without a stack entry we won't call it again to make it undo such actions.
So this is necessary to make the world safe for assign_hooks with side
effects.  Per a discussion a couple weeks ago with Magnus.

Back-patch to 8.0.  7.x did not have the problem because it did not have
allocatable stacks of GUC values.

16 years agoAdjust timestamp regression tests to prevent two low-probability failure
Tom Lane [Sun, 25 May 2008 21:51:00 +0000 (21:51 +0000)]
Adjust timestamp regression tests to prevent two low-probability failure
cases.  Recent buildfarm experience shows that it is sometimes possible
to execute several SQL commands in less time than the granularity of
Windows' not-very-high-resolution gettimeofday(), leading to a failure
because the tests expect the value of now() to change and it doesn't.
Also, it was recognized some time ago that the same area of the tests
could fail if local midnight passes between the insertion and the checking
of the values for 'yesterday', 'tomorrow', etc.  Clean all this up per
ideas from myself and Greg Stark.

There remains a window for failure if the transaction block is entered
exactly at local midnight (so that 'now' and 'today' have the same value),
but that seems low-probability enough to live with.

Since the point of this change is mostly to eliminate buildfarm noise,
back-patch to all versions we are still actively testing.

16 years agoLink in keywords file instead of copying it.
Michael Meskes [Wed, 21 May 2008 19:51:01 +0000 (19:51 +0000)]
Link in keywords file instead of copying it.
Use #define/#ifdef instead of sed to fix include files, this should work on Windows too.

16 years agoAdd include directory required after the latest changes to the ecpg build.
Magnus Hagander [Wed, 21 May 2008 18:15:29 +0000 (18:15 +0000)]
Add include directory required after the latest changes to the ecpg build.
Per red Windows buildfarm members.

16 years agoFix function headers not matching prototype in header file, per
Magnus Hagander [Wed, 21 May 2008 16:00:10 +0000 (16:00 +0000)]
Fix function headers not matching prototype in header file, per
compiler warnings on msvc.

16 years agoUse CRITICAL_SECTION instead of Mutexes for thread-locking in libpq on
Magnus Hagander [Wed, 21 May 2008 14:20:48 +0000 (14:20 +0000)]
Use CRITICAL_SECTION instead of Mutexes for thread-locking in libpq on
Windows, for better performance.

Per suggestion from Andrew Chernow, but not his patch since the underlying
code was changed to deal with return values.

16 years agoecpg_keywords.o also depends on preproc.h
Michael Meskes [Wed, 21 May 2008 00:26:26 +0000 (00:26 +0000)]
ecpg_keywords.o also depends on preproc.h

16 years agoSynced parser.
Michael Meskes [Tue, 20 May 2008 23:17:32 +0000 (23:17 +0000)]
Synced parser.
Made ecpg parser use backend provided keyword list.
Changed whenever test so exit value is 0.

16 years agoAdjust -Wl,--asneeded test to avoid using the switch if it breaks
Tom Lane [Tue, 20 May 2008 03:30:22 +0000 (03:30 +0000)]
Adjust -Wl,--asneeded test to avoid using the switch if it breaks
libreadline.  What we will do for compatibility :-(

16 years agoSimplify code in formatting.c now that to upper/lower/initcase do not
Bruce Momjian [Tue, 20 May 2008 01:41:02 +0000 (01:41 +0000)]
Simplify code in formatting.c now that to upper/lower/initcase do not
modify the passed string.

16 years agoDone:
Bruce Momjian [Tue, 20 May 2008 00:35:45 +0000 (00:35 +0000)]
Done:

<  o Use LC_TIME for localized weekday/month names, rather than
>  o -Use LC_TIME for localized weekday/month names, rather than

16 years agoRemove arbitrary 10MB limit on two-phase state file size. It's not that hard
Heikki Linnakangas [Mon, 19 May 2008 18:16:26 +0000 (18:16 +0000)]
Remove arbitrary 10MB limit on two-phase state file size. It's not that hard
to go beoynd 10MB, as demonstrated by Gavin Sharry's example of dropping a
schema with ~25000 objects. The really bogus thing about the limit was that
it was enforced when a state file file was read in, not when it was written,
so you would end up with a prepared transaction that you can't commit or
abort, and the only recourse was to shut down the server and remove the file
by hand.

Raise the limit to MaxAllocSize, and enforce it also when a state file is
written. We could've removed the limit altogether, but reading in a file
larger than MaxAllocSize would fail anyway because we read it into a
palloc'd buffer.

Backpatch down to 8.1, where 2PC and this issue was introduced.

16 years agoMake to_char()'s localized month/day names depend on LC_TIME, not LC_MESSAGES.
Tom Lane [Mon, 19 May 2008 18:08:16 +0000 (18:08 +0000)]
Make to_char()'s localized month/day names depend on LC_TIME, not LC_MESSAGES.

Euler Taveira de Oliveira

16 years agoCoercion sanity check in ri_HashCompareOp failed to allow for enums, as per
Tom Lane [Mon, 19 May 2008 04:14:24 +0000 (04:14 +0000)]
Coercion sanity check in ri_HashCompareOp failed to allow for enums, as per
example from Rod Taylor.  On reflection the correct test here is for any
polymorphic type, not specifically ANYARRAY as in the original coding.

16 years agoMake another try at using -Wl,--as-needed to suppress linking of unnecessary
Tom Lane [Sun, 18 May 2008 20:13:12 +0000 (20:13 +0000)]
Make another try at using -Wl,--as-needed to suppress linking of unnecessary
shared libraries.  We've tried this before and had problems with libreadline
not linking properly on some platforms, but that seems to be a libreadline
bug that may have been fixed by now.  In any case, it's early enough in the
8.4 devel cycle that we can afford to have some transient breakage while
we work out any portability problems.

On Darwin, we try -Wl,-dead_strip_dylibs, which seems to be the equivalent
incantation there.

16 years agoRemove old kluge put in to allow Windows regression tests to succeed, and now
Andrew Dunstan [Sun, 18 May 2008 06:50:08 +0000 (06:50 +0000)]
Remove old kluge put in to allow Windows regression tests to succeed, and now
found to have been made necessary by our skipping tty detection on Windows. Now
that we are doing tty detection on Windows the kluge is unnecessary and wrong.

16 years agookay, looks like ecpg/compatlib needs -lintl too.
Tom Lane [Sun, 18 May 2008 03:24:17 +0000 (03:24 +0000)]
okay, looks like ecpg/compatlib needs -lintl too.
Per buildfarm results.

16 years agoRewrite the warning about non-transaction-safety of TRUNCATE ... RESTART
Tom Lane [Sat, 17 May 2008 23:36:27 +0000 (23:36 +0000)]
Rewrite the warning about non-transaction-safety of TRUNCATE ... RESTART
IDENTITY to be more explicit about the possible hazards.  Per gripe from Neil
and subsequent discussion.  Eventually we may be able to get rid of this
warning, but for now it had better be there.

16 years agoUse isatty() test for pager on Win32; not sure why it was disabled for
Bruce Momjian [Sat, 17 May 2008 23:34:44 +0000 (23:34 +0000)]
Use isatty() test for pager on Win32;  not sure why it was disabled for
that platform.

16 years agoIn psql, test for output to stdout when forcing pager for wide output.
Bruce Momjian [Sat, 17 May 2008 21:40:44 +0000 (21:40 +0000)]
In psql, test for output to stdout when forcing pager for wide output.

16 years agoAnother fix for compiles on an empty 'po' directory.
Bruce Momjian [Sat, 17 May 2008 21:27:12 +0000 (21:27 +0000)]
Another fix for compiles on an empty 'po' directory.

16 years agoDon't call rm with empty file list.
Peter Eisentraut [Sat, 17 May 2008 20:24:05 +0000 (20:24 +0000)]
Don't call rm with empty file list.

16 years agoecpglib needs to link with libintl if it's in use.
Tom Lane [Sat, 17 May 2008 20:23:40 +0000 (20:23 +0000)]
ecpglib needs to link with libintl if it's in use.
Per buildfarm results.

16 years agoImprove pg_regress so that it reports the fact if any test process
Tom Lane [Sat, 17 May 2008 20:02:01 +0000 (20:02 +0000)]
Improve pg_regress so that it reports the fact if any test process
exits with nonzero status.  The Windows part of this is untested ...

16 years agoFix utterly-bogus code for computing row heights. Per crashes on
Tom Lane [Sat, 17 May 2008 17:52:14 +0000 (17:52 +0000)]
Fix utterly-bogus code for computing row heights.  Per crashes on
spoonbill, though one wonders why it didn't misbehave everywhere.
In passing remove some unnecessary modulo calculations.

16 years agoFix a subtle bug exposed by recent wal_sync_method rearrangements.
Tom Lane [Sat, 17 May 2008 17:24:57 +0000 (17:24 +0000)]
Fix a subtle bug exposed by recent wal_sync_method rearrangements.
Formerly, the default value of wal_sync_method was determined inside xlog.c,
but now it is determined inside guc.c.  guc.c was reading xlogdefs.h
without having read <fcntl.h>, leading to wrong determination of
DEFAULT_SYNC_METHOD.  Obviously xlogdefs.h needs to include <fcntl.h>
for itself to ensure stable results.

16 years agoRemove DEFAULT_SYNC_FLAGBIT ... not used anymore.
Tom Lane [Sat, 17 May 2008 16:49:23 +0000 (16:49 +0000)]
Remove DEFAULT_SYNC_FLAGBIT ... not used anymore.

16 years agofix ecpg regression tests broken by over-eager adding of $PostgreSQL$ markers
Andrew Dunstan [Sat, 17 May 2008 02:43:16 +0000 (02:43 +0000)]
fix ecpg regression tests broken by over-eager adding of $PostgreSQL$ markers

16 years agoAdd $PostgreSQL$ markers to a lot of files that were missing them.
Andrew Dunstan [Sat, 17 May 2008 01:28:26 +0000 (01:28 +0000)]
Add $PostgreSQL$ markers to a lot of files that were missing them.

This particular batch was just for *.c and *.h file.

The changes were made with the following 2 commands:

find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o  \( -name '*.[ch]'  \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | while read file ; do head -n 1 < $file | grep -q '^/\*' && echo $file; done | xargs -l sed -i -e '1s/^\// /' -e '1i/*\n * $PostgreSQL:$ \n *'

find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o  \( -name '*.[ch]'  \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | xargs -l sed -i -e '1i/*\n * $PostgreSQL:$ \n */'

16 years agoAllow ALTER SEQUENCE START WITH to change the recorded start_value of a
Tom Lane [Sat, 17 May 2008 01:20:39 +0000 (01:20 +0000)]
Allow ALTER SEQUENCE START WITH to change the recorded start_value of a
sequence.  This seems an obvious extension to the recent patch, and it
makes the code noticeably cleaner and more orthogonal.

16 years agoFix declarations of pthread functions, missed in recent commit.
Tom Lane [Fri, 16 May 2008 23:57:42 +0000 (23:57 +0000)]
Fix declarations of pthread functions, missed in recent commit.

16 years agoAdd a RESTART (without parameter) option to ALTER SEQUENCE, allowing a
Tom Lane [Fri, 16 May 2008 23:36:05 +0000 (23:36 +0000)]
Add a RESTART (without parameter) option to ALTER SEQUENCE, allowing a
sequence to be reset to its original starting value.  This requires adding the
original start value to the set of parameters (columns) of a sequence object,
which is a user-visible change with potential compatibility implications;
it also forces initdb.

Also add hopefully-SQL-compatible RESTART/CONTINUE IDENTITY options to
TRUNCATE TABLE.  RESTART IDENTITY executes ALTER SEQUENCE RESTART for all
sequences "owned by" any of the truncated relations.  CONTINUE IDENTITY is
a no-op option.

Zoltan Boszormenyi

16 years agoReduce unnecessary PANIC to ERROR, improve a couple of comments.
Tom Lane [Fri, 16 May 2008 19:15:05 +0000 (19:15 +0000)]
Reduce unnecessary PANIC to ERROR, improve a couple of comments.

16 years agoRecent patch doesn't compile without <limits.h>
Tom Lane [Fri, 16 May 2008 18:35:38 +0000 (18:35 +0000)]
Recent patch doesn't compile without <limits.h>

16 years agoSuppress a possibly-uninitialized-variable warning. (I'm only seeing it
Tom Lane [Fri, 16 May 2008 18:34:51 +0000 (18:34 +0000)]
Suppress a possibly-uninitialized-variable warning.  (I'm only seeing it
on Apple's gcc and not my other machines, but still it seems worth
getting rid of.)

16 years agoImplement error checking for pthreads calls in thread-safe mode. They really
Magnus Hagander [Fri, 16 May 2008 18:30:53 +0000 (18:30 +0000)]
Implement error checking for pthreads calls in thread-safe mode. They really
should always succeed, but in the likely event of a failure we would
previously fall through *without locking* - the new code will exit(1).

Printing the error message on stderr will not work for all applications, but
it's better than nothing at all - and our API doesn't provide a way to return
the error to the caller.

16 years agoSuppress compiler warning induced by recent header file refactoring.
Tom Lane [Fri, 16 May 2008 17:31:17 +0000 (17:31 +0000)]
Suppress compiler warning induced by recent header file refactoring.

16 years agoUpdate contrib for tsearch changes.
Tom Lane [Fri, 16 May 2008 17:26:07 +0000 (17:26 +0000)]
Update contrib for tsearch changes.

16 years agoUpdate psql startup banner to be shorter, suggest "help" for help.
Bruce Momjian [Fri, 16 May 2008 17:17:00 +0000 (17:17 +0000)]
Update psql startup banner to be shorter, suggest "help" for help.

Add a few "help" entries.

Move \g help entry into "General".

Update psql version mismatch warning text.

Joshua D. Drake

16 years agoDone in TODO:
Bruce Momjian [Fri, 16 May 2008 17:03:40 +0000 (17:03 +0000)]
Done in TODO:

>  o -Have \l+ show database size, if permissions allow

16 years agoAdd detection of psql pager to trigger on wide output. Also add pager
Bruce Momjian [Fri, 16 May 2008 16:59:05 +0000 (16:59 +0000)]
Add detection of psql pager to trigger on wide output.  Also add pager
detection for wrapped lines or lines with newlines that need pager to
display.

16 years agoExtend GIN to support partial-match searches, and extend tsquery to support
Tom Lane [Fri, 16 May 2008 16:31:02 +0000 (16:31 +0000)]
Extend GIN to support partial-match searches, and extend tsquery to support
prefix matching using this facility.

Teodor Sigaev and Oleg Bartunov

16 years agoAdd localization support to ecpg.
Peter Eisentraut [Fri, 16 May 2008 15:20:04 +0000 (15:20 +0000)]
Add localization support to ecpg.

Author: Euler Taveira de Oliveira <euler@timbira.com>

16 years agoDone:
Bruce Momjian [Fri, 16 May 2008 02:23:44 +0000 (02:23 +0000)]
Done:

PL/pgSQL

>  o -Add CASE capability to language (already in SQL)

16 years agoPersuade GIN to react to control-C in a reasonable amount of time
Tom Lane [Fri, 16 May 2008 01:27:06 +0000 (01:27 +0000)]
Persuade GIN to react to control-C in a reasonable amount of time
while building a GIN index.

16 years agoSupport SQL/PSM-compatible CASE statement in plpgsql.
Tom Lane [Thu, 15 May 2008 22:39:49 +0000 (22:39 +0000)]
Support SQL/PSM-compatible CASE statement in plpgsql.

Pavel Stehule

16 years agoAdd code to eval_const_expressions() to support const-simplification of
Tom Lane [Thu, 15 May 2008 17:37:49 +0000 (17:37 +0000)]
Add code to eval_const_expressions() to support const-simplification of
CoerceViaIO nodes.  This improves the ability of the planner to deal with
cases where the node input is a constant.  Per bug #4170.