postgresql.git
13 years agoConvert libpq regress script to Perl
Alvaro Herrera [Fri, 6 Jul 2012 19:38:11 +0000 (15:38 -0400)]
Convert libpq regress script to Perl

This should ease its use on the Windows build environment.

13 years agoUpdate libpq test expected output
Alvaro Herrera [Fri, 6 Jul 2012 20:23:30 +0000 (16:23 -0400)]
Update libpq test expected output

Commit 2b443063 changed wording for some of the error messages, but
neglected updating the regress output to match.

13 years agoRun updated copyright.pl on HEAD and 9.2 trees, updating the psql
Bruce Momjian [Fri, 6 Jul 2012 16:28:18 +0000 (12:28 -0400)]
Run updated copyright.pl on HEAD and 9.2 trees, updating the psql
\copyright output to 2012.

Backpatch to 9.2.

13 years agoHave copyright.pl skip updating something that is just the current year,
Bruce Momjian [Fri, 6 Jul 2012 16:21:43 +0000 (12:21 -0400)]
Have copyright.pl skip updating something that is just the current year,
to avoid producing dups, e.g. 2012-2012

Backpatch to 9.2.

13 years agoModify copyright.pl so all lines are processed, not just the first
Bruce Momjian [Fri, 6 Jul 2012 15:58:55 +0000 (11:58 -0400)]
Modify copyright.pl so all lines are processed, not just the first
match, so files that contain embedded copyrights are updated, e.g.
pgsql/help.c.

Backpatch to 9.2.

13 years agoFix copyright.pl to properly skip the .git directory by adding a
Bruce Momjian [Fri, 6 Jul 2012 15:43:59 +0000 (11:43 -0400)]
Fix copyright.pl to properly skip the .git directory by adding a
basename() qualification.

13 years agoFix spacing in copyright.pl after being run with missing regex slash
Bruce Momjian [Fri, 6 Jul 2012 14:57:08 +0000 (10:57 -0400)]
Fix spacing in copyright.pl after being run with missing regex slash
(now added).

Backpatch to 9.2.

13 years agoUpdate pg_upgrade comments for recent configpath fix.
Bruce Momjian [Fri, 6 Jul 2012 13:39:22 +0000 (09:39 -0400)]
Update pg_upgrade comments for recent configpath fix.

13 years agoFix failure of new wchar->mb functions to advance from pointer.
Robert Haas [Fri, 6 Jul 2012 03:47:53 +0000 (23:47 -0400)]
Fix failure of new wchar->mb functions to advance from pointer.

Bug spotted by Tom Lane.

13 years agoFix PGDATAOLD and PGDATANEW to properly set pgconfig location, per
Bruce Momjian [Fri, 6 Jul 2012 03:36:30 +0000 (23:36 -0400)]
Fix PGDATAOLD and PGDATANEW to properly set pgconfig location, per
report from Tom.

Backpatch to 9.2.

13 years agoDon't try to trim "../" in join_path_components().
Tom Lane [Thu, 5 Jul 2012 21:15:05 +0000 (17:15 -0400)]
Don't try to trim "../" in join_path_components().

join_path_components() tried to remove leading ".." components from its
tail argument, but it was not nearly bright enough to do so correctly
unless the head argument was (a) absolute and (b) canonicalized.
Rather than try to fix that logic, let's just get rid of it: there is no
correctness reason to remove "..", and cosmetic concerns can be taken
care of by a subsequent canonicalize_path() call.  Per bug #6715 from
Greg Davidson.

Back-patch to all supported branches.  It appears that pre-9.2, this
function is only used with absolute paths as head arguments, which is why
we'd not noticed the breakage before.  However, third-party code might be
expecting this function to work in more general cases, so it seems wise
to back-patch.

In HEAD and 9.2, also make some minor cosmetic improvements to callers.

13 years agoRevert part of the previous patch that avoided using PLy_elog().
Heikki Linnakangas [Thu, 5 Jul 2012 20:40:25 +0000 (23:40 +0300)]
Revert part of the previous patch that avoided using PLy_elog().

That caused the plpython_unicode regression test to fail on SQL_ASCII
encoding, as evidenced by the buildfarm. The reason is that with the patch,
you don't get the detail in the error message that you got before. That
detail is actually very informative, so rather than just adjust the expected
output, let's revert that part of the patch for now to make the buildfarm
green again, and figure out some other way to avoid the recursion of
PLy_elog() that doesn't lose the detail.

13 years agoFix mapping of PostgreSQL encodings to Python encodings.
Heikki Linnakangas [Thu, 5 Jul 2012 18:45:24 +0000 (21:45 +0300)]
Fix mapping of PostgreSQL encodings to Python encodings.

Windows encodings, "win1252" and so forth, are named differently in Python,
like "cp1252". Also, if the PyUnicode_AsEncodedString() function call fails
for some reason, use a plain ereport(), not a PLy_elog(), to report that
error. That avoids recursion and crash, if PLy_elog() tries to call
PLyUnicode_Bytes() again.

This fixes bug reported by Asif Naeem. Backpatch down to 9.0, before that
plpython didn't even try these conversions.

Jan Urbański, with minor comment improvements by me.

13 years agoRemove support for using wait3() in place of waitpid().
Tom Lane [Thu, 5 Jul 2012 18:00:40 +0000 (14:00 -0400)]
Remove support for using wait3() in place of waitpid().

All Unix-oid platforms that we currently support should have waitpid(),
since it's in V2 of the Single Unix Spec.  Our git history shows that
the wait3 code was added to support NextStep, which we officially dropped
support for as of 9.2.  So get rid of the configure test, and simplify the
macro spaghetti in reaper().  Per suggestion from Fujii Masao.

13 years agopg_upgrade: abstract out copying of files from old cluster to new
Alvaro Herrera [Thu, 5 Jul 2012 15:38:42 +0000 (11:38 -0400)]
pg_upgrade: abstract out copying of files from old cluster to new

Currently only pg_clog is copied, but some other directories could need
the same treatment as well, so create a subroutine to do it.

Extracted from my (somewhat larger) FOR KEY SHARE patch.

13 years agoFix function argument tab completion for schema-qualified or quoted function names
Magnus Hagander [Thu, 5 Jul 2012 12:03:49 +0000 (14:03 +0200)]
Fix function argument tab completion for schema-qualified or quoted function names

Dean Rasheed, reviewed by Josh Kupershmidt

13 years agoFix missing regex slash that caused perltidy to get confused on
Bruce Momjian [Thu, 5 Jul 2012 01:58:48 +0000 (21:58 -0400)]
Fix missing regex slash that caused perltidy to get confused on
copyright.pl.

Backpatch to 9.2.

13 years agoRun newly-configured perltidy script on Perl files.
Bruce Momjian [Thu, 5 Jul 2012 01:47:49 +0000 (21:47 -0400)]
Run newly-configured perltidy script on Perl files.

Run on HEAD and 9.2.

13 years agoReduce messages about implicit indexes and sequences to DEBUG1.
Robert Haas [Thu, 5 Jul 2012 00:34:24 +0000 (20:34 -0400)]
Reduce messages about implicit indexes and sequences to DEBUG1.

Per recent discussion on pgsql-hackers, these messages are too
chatty for most users.

13 years agoHave pg_dump in binary-upgrade mode properly drop user-created
Bruce Momjian [Wed, 4 Jul 2012 21:36:50 +0000 (17:36 -0400)]
Have pg_dump in binary-upgrade mode properly drop user-created
extensions that might exist in the new empty cluster databases, like
plpgsql.

Backpatch to 9.2.

13 years agoFix sample INSTR function to return 0 if third arg is 0.
Robert Haas [Wed, 4 Jul 2012 21:19:23 +0000 (17:19 -0400)]
Fix sample INSTR function to return 0 if third arg is 0.

Albe Laurenz, per a report by Greg Smith that our sample function
doesn't quite match Oracle's behavior.

13 years agoAdd wchar -> mb conversion routines.
Robert Haas [Wed, 4 Jul 2012 21:10:10 +0000 (17:10 -0400)]
Add wchar -> mb conversion routines.

This is infrastructure for Alexander Korotkov's work on indexing regular
expression searches.

Alexander Korotkov, with a bit of further hackery on the MULE conversion
by me

13 years agoMore doc cleanups for recent shared memory changes.
Robert Haas [Wed, 4 Jul 2012 19:57:48 +0000 (15:57 -0400)]
More doc cleanups for recent shared memory changes.

Josh Kupershmidt

13 years agoDocumentation cleanups for recent shared memory changes.
Robert Haas [Wed, 4 Jul 2012 19:56:12 +0000 (15:56 -0400)]
Documentation cleanups for recent shared memory changes.

13 years agoIncrease the maximum initdb-configured value for shared_buffers to 128MB.
Robert Haas [Wed, 4 Jul 2012 19:52:35 +0000 (15:52 -0400)]
Increase the maximum initdb-configured value for shared_buffers to 128MB.

The old value of 32MB has been around for a very long time, and in the
meantime typical system memories have become vastly larger.  Also, now
that we no longer depend on being able to fit the entirety of our
shared memory segment into the system's limit on System V shared
memory, there's a much better chance of the higher limit actually
proving productive.

Per recent discussion on pgsql-hackers.

13 years agoMake oid2name, pgbench, and vacuumlo set fallback_application_name.
Robert Haas [Wed, 4 Jul 2012 19:39:33 +0000 (15:39 -0400)]
Make oid2name, pgbench, and vacuumlo set fallback_application_name.

Amit Kapila, reviewed by Shigeru Hanada and Peter Eisentraut,
with some modifications by me.

13 years agoRemove duplicate, unnecessary, variable declaration
Magnus Hagander [Wed, 4 Jul 2012 14:16:54 +0000 (16:16 +0200)]
Remove duplicate, unnecessary, variable declaration

13 years agoSet the write location in the pg_receivexlog status messages
Magnus Hagander [Wed, 4 Jul 2012 13:13:09 +0000 (15:13 +0200)]
Set the write location in the pg_receivexlog status messages

This makes it possible for the master to track how much data has
actually been written my pg_receivexlog - and not just how much
has been sent towards it.

13 years agoAlways treat a standby returning an an invalid flush location as async
Magnus Hagander [Wed, 4 Jul 2012 13:10:46 +0000 (15:10 +0200)]
Always treat a standby returning an an invalid flush location as async

This ensures that a standby such as pg_receivexlog will not be selected
as sync standby - which would cause the master to block waiting for
a location that could never happen.

Fujii Masao

13 years agoRemove reference to default wal_buffers being 8
Magnus Hagander [Wed, 4 Jul 2012 07:22:21 +0000 (09:22 +0200)]
Remove reference to default wal_buffers being 8

This hasn't been true since 9.1, when the default was changed to -1.
Remove the reference completely, keeping the discussion of the parameter
and it's shared memory effects on the config page.

13 years agoRemove references to pgfoundry as recommended hosting platform
Magnus Hagander [Wed, 4 Jul 2012 06:59:35 +0000 (08:59 +0200)]
Remove references to pgfoundry as recommended hosting platform

pgfoundry is deprectaed and no longer accepting new projects,
so we really shouldn't be directing people there.

13 years agoRemove references to PostgreSQL bundled on Solaris
Magnus Hagander [Wed, 4 Jul 2012 06:58:31 +0000 (08:58 +0200)]
Remove references to PostgreSQL bundled on Solaris

Also remove special references to downloads off pgfoundry since they are
not correct - downloads are done through the main website.

13 years agoImprove documentation about MULE encoding.
Tom Lane [Wed, 4 Jul 2012 04:29:57 +0000 (00:29 -0400)]
Improve documentation about MULE encoding.

This commit improves the comments in pg_wchar.h and creates #define symbols
for some formerly hard-coded values.  No substantive code changes.

Tatsuo Ishii and Tom Lane

13 years agoForgot an #include in the previous patch :-(
Alvaro Herrera [Tue, 3 Jul 2012 20:40:15 +0000 (16:40 -0400)]
Forgot an #include in the previous patch :-(

13 years agoHave REASSIGN OWNED work on extensions, too
Alvaro Herrera [Tue, 3 Jul 2012 19:09:59 +0000 (15:09 -0400)]
Have REASSIGN OWNED work on extensions, too

Per bug #6593, REASSIGN OWNED fails when the affected role has created
an extension.  Even though the user related to the extension is not
nominally the owner, its OID appears on pg_shdepend and thus causes
problems when the user is to be dropped.

This commit adds code to change the "ownership" of the extension itself,
not of the contained objects.  This is fine because it's currently only
called from REASSIGN OWNED, which would also modify the ownership of the
contained objects.  However, this is not sufficient for a working ALTER
OWNER implementation extension.

Back-patch to 9.1, where extensions were introduced.

Bug #6593 reported by Emiliano Leporati.

13 years agoHave copyright tool mention that certain files should be updated in back branches.
Bruce Momjian [Tue, 3 Jul 2012 16:01:38 +0000 (12:01 -0400)]
Have copyright tool mention that certain files should be updated in back branches.

13 years agoRemove misleading hints about reducing the System V request size.
Robert Haas [Tue, 3 Jul 2012 14:07:47 +0000 (10:07 -0400)]
Remove misleading hints about reducing the System V request size.

Since the request size will now be ~48 bytes regardless of how
shared_buffers et. al. are set, much of this advice is no longer
relevant.

13 years agoFix a stupid bug I introduced into XLogFlush().
Robert Haas [Mon, 2 Jul 2012 19:33:59 +0000 (15:33 -0400)]
Fix a stupid bug I introduced into XLogFlush().

Commit f11e8be3e812cdbbc139c1b4e49141378b118dee broke this; it was right
in Peter's original patch, but I messed it up before committing.

13 years agoFix position of WalSndWakeupRequest call.
Robert Haas [Mon, 2 Jul 2012 18:43:10 +0000 (14:43 -0400)]
Fix position of WalSndWakeupRequest call.

This avoids discriminating against wal_sync_method = open_sync or
open_datasync.

Fujii Masao, reviewed by Andres Freund

13 years agoAssorted message style improvements
Peter Eisentraut [Mon, 2 Jul 2012 18:12:46 +0000 (21:12 +0300)]
Assorted message style improvements

13 years agoFix to_date's handling of year 519.
Tom Lane [Mon, 2 Jul 2012 15:35:21 +0000 (11:35 -0400)]
Fix to_date's handling of year 519.

A thinko in commit 029dfdf1157b6d837a7b7211cd35b00c6bcd767c caused the year
519 to be handled differently from either adjacent year, which was not the
intention AFAICS.  Report and diagnosis by Marc Cousin.

In passing, remove redundant re-tests of year value.

13 years agoWork a little harder on comments for walsender wakeup patch.
Robert Haas [Mon, 2 Jul 2012 15:28:53 +0000 (11:28 -0400)]
Work a little harder on comments for walsender wakeup patch.

Per gripe from Tom Lane.

13 years agoMake commit_delay much smarter.
Robert Haas [Mon, 2 Jul 2012 14:26:31 +0000 (10:26 -0400)]
Make commit_delay much smarter.

Instead of letting every backend participating in a group commit wait
independently, have the first one that becomes ready to flush WAL wait
for the configured delay, and let all the others wait just long enough
for that first process to complete its flush.  This greatly increases
the chances of being able to configure a commit_delay setting that
actually improves performance.

As a side consequence of this change, commit_delay now affects all WAL
flushes, rather than just commits.  There was some discussion on
pgsql-hackers about whether to rename the GUC to, say, wal_flush_delay,
but in the absence of consensus I am leaving it alone for now.

Peter Geoghegan, with some changes, mostly to the documentation, by me.

13 years agoMake walsender more responsive.
Robert Haas [Mon, 2 Jul 2012 13:36:34 +0000 (09:36 -0400)]
Make walsender more responsive.

Per testing by Andres Freund, this improves replication performance
and reduces replication latency and latency jitter.  I was a bit
concerned about moving more work into XLogInsert, but testing seems
to show that it's not a problem in practice.

Along the way, improve comments for WaitLatchOrSocket.

Andres Freund.  Review and stylistic cleanup by me.

13 years agoFix race condition in enum value comparisons.