users/simon/postgres.git
15 years agoCorrectly handle abort of a subtransaction that is an overflowed subtransaction on... hot_standby
Simon Riggs [Wed, 7 Oct 2009 13:50:52 +0000 (14:50 +0100)]
Correctly handle abort of a subtransaction that is an overflowed subtransaction on primary, so on standby the subxid has already been removed from KnownAssignedXids by an xid assignment record. We check subtrans to see if xid is valid there.

15 years agoUpdate docs to reflect existing restrictions on settings of various max_* parameters.
Simon Riggs [Wed, 7 Oct 2009 13:15:06 +0000 (14:15 +0100)]
Update docs to reflect existing restrictions on settings of various max_* parameters.

15 years agoMerge branch 'master' into hot_standby
Simon Riggs [Tue, 6 Oct 2009 17:23:11 +0000 (18:23 +0100)]
Merge branch 'master' into hot_standby

15 years agoApply 0017-Revert-changes-to-subtrans.c-and-slru.c.-Instead-cal. but with heavy...
Simon Riggs [Tue, 6 Oct 2009 11:50:13 +0000 (12:50 +0100)]
Apply 0017-Revert-changes-to-subtrans.c-and-slru.c.-Instead-cal. but with heavy modifications to fix a number of bugs and make associated changes. First, StartupSubtrans() positioned itself at oldestXid, so that when later running transactions complete they could find no page for them to update and crash. Second, ExtendClog() expected to be able to write WAL during recovery and so crashed after 32768 xids. This  also extends the  to cover the recently added support for starting Hot Standby from a shutdown checkpoint, which causes some refactoring. Various comments reworded, including allowing a lock overflow to cause a PENDING state, just as we do with subxid overflow. Another bug was also found, in that failing to make subtrans entries from the initial snapshot could lead to later abort records hanging because the topxid was not set. Code is now similar in all code paths. Sounds like a lot of changes, but mostly subtle changes rather than lengthy ones.

15 years agoApply 0013-Remove-dead-memset-call.
Simon Riggs [Tue, 6 Oct 2009 09:20:58 +0000 (10:20 +0100)]
Apply 0013-Remove-dead-memset-call.

15 years agoChange CREATE TABLE so that column default expressions coming from different master
Tom Lane [Tue, 6 Oct 2009 00:55:26 +0000 (00:55 +0000)]
Change CREATE TABLE so that column default expressions coming from different
inheritance parent tables are compared using equal(), instead of doing
strcmp() on the nodeToString representation.  The old implementation was
always a tad cheesy, and it finally fails completely as of 8.4, now that the
node tree might contain syntax location information.  equal() knows it's
supposed to ignore those fields, but strcmp() hardly can.  Per recent
report from Scott Ribe.

15 years agoReally unbreak maintainer-clean.
Alvaro Herrera [Tue, 6 Oct 2009 00:54:26 +0000 (00:54 +0000)]
Really unbreak maintainer-clean.

(Or rather, unbreak what the previous commit broke)

15 years agoUnbreak doc/src/sgml maintainer-clean rule on VPATH builds.
Alvaro Herrera [Mon, 5 Oct 2009 23:58:49 +0000 (23:58 +0000)]
Unbreak doc/src/sgml maintainer-clean rule on VPATH builds.

15 years agoMinor comment change
Simon Riggs [Mon, 5 Oct 2009 21:13:59 +0000 (22:13 +0100)]
Minor comment change

15 years agoPut back code marked "do not remove" to avoid errors on commit and abort records...
Simon Riggs [Mon, 5 Oct 2009 19:33:05 +0000 (20:33 +0100)]
Put back code marked "do not remove" to avoid errors on commit and abort records that haven't previously notified recovery of their xids. Strangely this is the second time I've put that code back, hence the previous "do not remove" comment.

15 years agoCreate an ALTER DEFAULT PRIVILEGES command, which allows users to adjust
Tom Lane [Mon, 5 Oct 2009 19:24:49 +0000 (19:24 +0000)]
Create an ALTER DEFAULT PRIVILEGES command, which allows users to adjust
the privileges that will be applied to subsequently-created objects.

Such adjustments are always per owning role, and can be restricted to objects
created in particular schemas too.  A notable benefit is that users can
override the traditional default privilege settings, eg, the PUBLIC EXECUTE
privilege traditionally granted by default for functions.

Petr Jelinek

15 years agoApply 0014-Make-locking-of-ShmemVariableCache-nextXid-in-multix.
Simon Riggs [Mon, 5 Oct 2009 14:13:37 +0000 (15:13 +0100)]
Apply 0014-Make-locking-of-ShmemVariableCache-nextXid-in-multix.

15 years agoApply 0010-Make-recoveryTargetMode-an-enum.
Simon Riggs [Mon, 5 Oct 2009 14:09:47 +0000 (15:09 +0100)]
Apply 0010-Make-recoveryTargetMode-an-enum.

15 years agoApply 0009-Use-ereport-rather-than-elog-for-user-facing-errors... Prevents non...
Simon Riggs [Mon, 5 Oct 2009 13:59:10 +0000 (14:59 +0100)]
Apply 0009-Use-ereport-rather-than-elog-for-user-facing-errors... Prevents non-normal xids from being specified during recovery, which is still allowed for recovery_target_xid.

15 years agoApply heikki1/0012-Don-t-hold-RecoveryInfoLock-over-lock-sleep.
Simon Riggs [Mon, 5 Oct 2009 13:52:36 +0000 (14:52 +0100)]
Apply heikki1/0012-Don-t-hold-RecoveryInfoLock-over-lock-sleep.

15 years agoApply 0010-Use-right-codes-for-conflictMode.-Whitespace-comment.
Simon Riggs [Mon, 5 Oct 2009 13:49:52 +0000 (14:49 +0100)]
Apply 0010-Use-right-codes-for-conflictMode.-Whitespace-comment.

15 years agoApply 0009-Simplify-RelationReleaseRecoveryLocks-to-manage-with.
Simon Riggs [Mon, 5 Oct 2009 13:44:18 +0000 (14:44 +0100)]
Apply 0009-Simplify-RelationReleaseRecoveryLocks-to-manage-with.

15 years agoApply 0008-Don-t-try-to-pin-and-lock-every-page-in-replay-of-b-.
Simon Riggs [Mon, 5 Oct 2009 13:31:07 +0000 (14:31 +0100)]
Apply 0008-Don-t-try-to-pin-and-lock-every-page-in-replay-of-b-.
All Good.

15 years agoApply 0007-Need-to-pin-and-take-cleanup-lock-on-every-b-tree-le. with some docs...
Simon Riggs [Mon, 5 Oct 2009 13:28:34 +0000 (14:28 +0100)]
Apply 0007-Need-to-pin-and-take-cleanup-lock-on-every-b-tree-le. with some docs changes.
All code changes approved, especially the neat tweak to improve performance in btree vacuum.

15 years agoMake some changes to code and comments in KnownAssignedXids functions. Based upon...
Simon Riggs [Mon, 5 Oct 2009 13:17:20 +0000 (14:17 +0100)]
Make some changes to code and comments in KnownAssignedXids functions. Based upon changes in 0006-Fix-comments-in-known-assigned-xids-module-about-whe., but one XXX comment replaced by a code change. The comment change to say that KnownAssignedXidsRemove needs only a share lock is wrong and has not been applied.

15 years agoApply Heikki's 0003-Simplify-unreported-xid-tracking. which re-writes his re...
Simon Riggs [Mon, 5 Oct 2009 13:03:07 +0000 (14:03 +0100)]
Apply Heikki's 0003-Simplify-unreported-xid-tracking. which re-writes his re-write of how that works, so that it fixes a bug in the way the previous version worked.

15 years agoAdd refactor 0013-Use-plain-old-XLogNeedsFlush-instead-of-the-new-DBCo.
Simon Riggs [Mon, 5 Oct 2009 12:50:57 +0000 (13:50 +0100)]
Add refactor  0013-Use-plain-old-XLogNeedsFlush-instead-of-the-new-DBCo.

15 years agoApply Heikki's changes to replace RecordKnownAssignedTransactionIds() back to the...
Simon Riggs [Mon, 5 Oct 2009 12:43:01 +0000 (13:43 +0100)]
Apply Heikki's changes to replace RecordKnownAssignedTransactionIds() back to the way it was in November 2008. Hey ho.
 0014-Call-RecordKnownAssignedTransactionIds-once-just-bef.

15 years agoApply changes from Heikki's 0005-Make-sure-we-hold-ProcArrayLock-while-we-set-recover...
Simon Riggs [Mon, 5 Oct 2009 11:16:11 +0000 (12:16 +0100)]
Apply changes from Heikki's 0005-Make-sure-we-hold-ProcArrayLock-while-we-set-recover.

15 years agoApply changes from Heikki's 0004-Fix-off-by-one-error-in-GetConflictingVirtualXIDs...
Simon Riggs [Mon, 5 Oct 2009 11:08:11 +0000 (12:08 +0100)]
Apply changes from Heikki's 0004-Fix-off-by-one-error-in-GetConflictingVirtualXIDs.-W.

15 years agoApply changes from Heikki's 0003-Advance-ShmemVariableCache-nextXid-before-marking...
Simon Riggs [Mon, 5 Oct 2009 11:02:59 +0000 (12:02 +0100)]
Apply changes from Heikki's 0003-Advance-ShmemVariableCache-nextXid-before-marking-xi..

15 years agoApply changes from Heikki's 001-Remove-now-unnecessary-extern-declaration. 28-Sep
Simon Riggs [Mon, 5 Oct 2009 10:57:34 +0000 (11:57 +0100)]
Apply changes from Heikki's 001-Remove-now-unnecessary-extern-declaration. 28-Sep

15 years agoApply changes from Heikki's 0015-merge-initLatestRunningXactData.. etc.
Simon Riggs [Mon, 5 Oct 2009 10:54:37 +0000 (11:54 +0100)]
Apply changes from Heikki's  0015-merge-initLatestRunningXactData.. etc.
Reworks 2 boolean variables into a 3-state variable. In a seperate change, that  also included API changes to two other functions, one for streamlining, one because of an unused variable.
Also update ProcArrayInitRecoveryInfo() so that it reflects these changes.

15 years agoApply remaining minor docs changes from Heikki's 0016-Oops-check...
Simon Riggs [Mon, 5 Oct 2009 10:23:05 +0000 (11:23 +0100)]
Apply remaining minor docs changes from Heikki's  0016-Oops-check...

15 years agoApply changes from Heikki's 0002-Comment-whitespace.. etc
Simon Riggs [Mon, 5 Oct 2009 10:18:03 +0000 (11:18 +0100)]
Apply changes from Heikki's  0002-Comment-whitespace.. etc
Which contained some code changes as well, all very minor, all approved.

15 years agoApply changes from Heikki's 001-Remove-some-dead-code... etc
Simon Riggs [Mon, 5 Oct 2009 10:04:52 +0000 (11:04 +0100)]
Apply changes from Heikki's  001-Remove-some-dead-code... etc
Minor comment editing by me

15 years agoSmall doc change. max_standby_delay = -1 during archive recovery
Simon Riggs [Mon, 5 Oct 2009 08:12:44 +0000 (09:12 +0100)]
Small doc change. max_standby_delay = -1 during archive recovery

15 years agoDocument the purpose of the GUC listen_addresses.
Bruce Momjian [Sat, 3 Oct 2009 23:10:47 +0000 (23:10 +0000)]
Document the purpose of the GUC listen_addresses.

15 years agoFix assorted memory s in pg_hba.conf parsing. Over a sufficiently
Tom Lane [Sat, 3 Oct 2009 20:04:39 +0000 (20:04 +0000)]
Fix assorted memory s in pg_hba.conf parsing.  Over a sufficiently
large number of SIGHUP cycles, these would have run the postmaster out
of memory.  Noted while testing memory- scenario in postgresql.conf
configuration-change-printing .

15 years agoFix a couple of issues in recent to print updates to postgresql.conf
Tom Lane [Sat, 3 Oct 2009 18:04:57 +0000 (18:04 +0000)]
Fix a couple of issues in recent  to print updates to postgresql.conf
settings: avoid calling superuser() in contexts where it's not defined,
don't  the transient copies of GetConfigOption output, and avoid the
whole exercise in postmaster child processes.

I found that actually no current caller of GetConfigOption has any use for
its internal check of GUC_SUPERUSER_ONLY.  But rather than just remove
that entirely, it seemed better to add a parameter indicating whether to
enforce the check.

Per report from Simon and subsequent testing.

15 years agoFix an oversight in an 8.3-era : pgstat_initstats should allow stats
Tom Lane [Fri, 2 Oct 2009 22:49:50 +0000 (22:49 +0000)]
Fix an oversight in an 8.3-era : pgstat_initstats should allow stats
to be collected for sequences.

Report and fix by Akira Kurosawa

15 years agoMake sure that GIN fast-insert and regular code paths enforce the same
Tom Lane [Fri, 2 Oct 2009 21:14:04 +0000 (21:14 +0000)]
Make sure that GIN fast-insert and regular code paths enforce the same
tuple size limit.  Improve the error message for index-tuple-too-large
so that it includes the actual size, the limit, and the index name.
Sync with the btree occurrences of the same error.

Back- to 8.4 because it appears that the out-of-sync problem
is occurring in the field.

Teodor and Tom

15 years agoResolve a race condition on update of ShmemVariableCache->latestCompletedXid,
Simon Riggs [Fri, 2 Oct 2009 20:28:14 +0000 (21:28 +0100)]
Resolve a race condition on update of ShmemVariableCache->latestCompletedXid,
plus use XidGenLock during xact_redo_abort() as in xact_redo_commit().
Some changes direct from Heikki, others address code review comments from Heikki.

15 years agoFirst cut at being able to use shutdown checkpoints as valid starting places for...
Simon Riggs [Fri, 2 Oct 2009 19:57:01 +0000 (20:57 +0100)]
First cut at being able to use shutdown checkpoints as valid starting places for Hot Standby.

15 years agoFix erroneous handling of shared dependencies (ie dependencies on roles)
Tom Lane [Fri, 2 Oct 2009 18:13:04 +0000 (18:13 +0000)]
Fix erroneous handling of shared dependencies (ie dependencies on roles)
in CREATE OR REPLACE FUNCTION.  The original code would update pg_shdepend
as if a new function was being created, even if it wasn't, with two bad
consequences: pg_shdepend might record the wrong owner for the function,
and any dependencies for roles mentioned in the function's ACL would be lost.
The fix is very easy: just don't touch pg_shdepend at all when doing a
function replacement.

Also update the CREATE FUNCTION reference page, which never explained
exactly what changes and doesn't change in a function replacement.
In passing, fix the CREATE VIEW reference page similarly; there's no
code bug there, but the docs didn't say what happens.

15 years agoEnsure that a cursor has an immutable snapshot throughout its lifespan.
Alvaro Herrera [Fri, 2 Oct 2009 17:57:30 +0000 (17:57 +0000)]
Ensure that a cursor has an immutable snapshot throughout its lifespan.

The old coding was using a regular snapshot, referenced elsewhere, that was
subject to having its command counter updated.  Fix by creating a private copy
of the snapshot exclusively for the cursor.

Back to 8.4, which is when the bug was introduced during the snapshot
management rewrite.

15 years agoRevert all recent changes about shutdown checkpoints and GetRunningTransactionData...
Simon Riggs [Fri, 2 Oct 2009 13:07:49 +0000 (14:07 +0100)]
Revert all recent changes about shutdown checkpoints and GetRunningTransactionData() and put item back on todo list, for now.

15 years agoRe-arrange placement of GetRunningTransactionData() so that
Simon Riggs [Fri, 2 Oct 2009 09:50:32 +0000 (10:50 +0100)]
Re-arrange placement of GetRunningTransactionData() so that
it occurs in same place always, whatever mode we are in. Call now occurs after we get REDO pointer for checkpoint yet before we checkpoint and write the checkpoint WAL record.

15 years agoAdd in extra GetRunningTransactionData after shutdown checkpoint.
Simon Riggs [Fri, 2 Oct 2009 07:33:44 +0000 (08:33 +0100)]
Add in extra GetRunningTransactionData after shutdown checkpoint.

15 years agoApplied by Boszormenyi Zoltan <[email protected]> to fix memory in decimal...
Michael Meskes [Thu, 1 Oct 2009 18:03:54 +0000 (18:03 +0000)]
Applied  by Boszormenyi Zoltan <[email protected]> to fix memory  in decimal handling.

15 years agoTransactionIdIsInProgress() must check KnownAssignedXids.
Simon Riggs [Thu, 1 Oct 2009 16:39:28 +0000 (17:39 +0100)]
TransactionIdIsInProgress() must check KnownAssignedXids.

15 years agoWhen we ExpireOldKnownAssignedTransactionIds() we must also remove any locks that...
Simon Riggs [Thu, 1 Oct 2009 15:37:59 +0000 (16:37 +0100)]
When we ExpireOldKnownAssignedTransactionIds() we must also remove any locks that may have been held by those stale transactions. We now call RelationReleaseOldRecoveryLocks() to ensure locks are cleared up.

15 years agoDocument recommendation to set max_standby_delay = 0 during archive recovery.
Simon Riggs [Thu, 1 Oct 2009 15:18:07 +0000 (16:18 +0100)]
Document recommendation to set max_standby_delay = 0 during archive recovery.

15 years agoRemove any changes to StartupMultiXact(). MultiXact is never accessed at this point...
Simon Riggs [Thu, 1 Oct 2009 15:17:09 +0000 (16:17 +0100)]
Remove any changes to StartupMultiXact(). MultiXact is never accessed at this point in startup sequence, so locking changes are not required for Hot Standby .

15 years agoDo GetRunningTransactionData() immediately prior to a shutdown checkpoint.
Simon Riggs [Thu, 1 Oct 2009 15:11:51 +0000 (16:11 +0100)]
Do GetRunningTransactionData() immediately prior to a shutdown checkpoint.

15 years agoRemove special handling of very long standby delays.
Simon Riggs [Thu, 1 Oct 2009 15:04:23 +0000 (16:04 +0100)]
Remove special handling of very long standby delays.

15 years agoSupport "samehost" and "samenet" specifications in pg_hba.conf,
Tom Lane [Thu, 1 Oct 2009 01:58:58 +0000 (01:58 +0000)]
Support "samehost" and "samenet" specifications in pg_hba.conf,
by enumerating the machine's IP interfaces to look for a match.

Stef Walter

15 years agoFix bogus Assert, per buildfarm results.
Tom Lane [Wed, 30 Sep 2009 21:26:17 +0000 (21:26 +0000)]
Fix bogus Assert, per buildfarm results.

15 years agoAssorted improvements in contrib/hstore.
Tom Lane [Wed, 30 Sep 2009 19:50:22 +0000 (19:50 +0000)]
Assorted improvements in contrib/hstore.

Remove the 64K limit on the lengths of keys and values within an hstore.
(This changes the on-disk format, but the old format can still be read.)
Add support for btree/hash opclasses for hstore --- this is not so much
for actual indexing purposes as to allow use of GROUP BY, DISTINCT, etc.
Add various other new functions and operators.

Andrew Gierth

15 years agoAdd tooltips to the header links, and make title a link to the home page
Peter Eisentraut [Tue, 29 Sep 2009 20:25:01 +0000 (20:25 +0000)]
Add tooltips to the header links, and make title a link to the home page

based on an idea by Richard Huxton

15 years agoAllow MOVE FORWARD n, MOVE BACKWARD n, MOVE FORWARD ALL, MOVE BACKWARD ALL
Tom Lane [Tue, 29 Sep 2009 20:05:29 +0000 (20:05 +0000)]
Allow MOVE FORWARD n, MOVE BACKWARD n, MOVE FORWARD ALL, MOVE BACKWARD ALL
in plpgsql.  Clean up a couple of corner cases in the MOVE/FETCH syntax.

Pavel Stehule

15 years agoFix equivclass.c's not-quite-right strategy for handling X=X clauses.
Tom Lane [Tue, 29 Sep 2009 01:20:34 +0000 (01:20 +0000)]
Fix equivclass.c's not-quite-right strategy for handling X=X clauses.

The original coding correctly noted that these aren't just redundancies
(they're effectively X IS NOT NULL, assuming = is strict).  However, they
got treated that way if X happened to be in a single-member EquivalenceClass
already, which could happen if there was an ORDER BY X clause, for instance.
The simplest and most reliable solution seems to be to not try to process
such clauses through the EquivalenceClass machinery; just throw them back
for traditional processing.  The amount of work that'd be needed to be
smarter than that seems out of proportion to the benefit.

Per bug #5084 from Bernt Marius Johnsen, and analysis by Andrew Gierth.

15 years agoConvert a perl array to a postgres array when returned by Set Returning Functions...
Andrew Dunstan [Mon, 28 Sep 2009 17:31:12 +0000 (17:31 +0000)]
Convert a perl array to a postgres array when returned by Set Returning Functions as well as non SRFs. Back to 8.1 where these facilities were introduced. with a little help from Abhijit Menon-Sen.

15 years agoAdded some explanation about how the parser is generated, taken from an email by
Michael Meskes [Mon, 28 Sep 2009 08:50:57 +0000 (08:50 +0000)]
Added some explanation about how the parser is generated, taken from an email by
Zoltan Boszormenyi <[email protected]>.

15 years agoRemove no-longer-needed ExecCountSlots infrastructure.
Tom Lane [Sun, 27 Sep 2009 21:10:53 +0000 (21:10 +0000)]
Remove no-longer-needed ExecCountSlots infrastructure.

15 years agoReplace the array-style TupleTable data structure with a simple List of
Tom Lane [Sun, 27 Sep 2009 20:09:58 +0000 (20:09 +0000)]
Replace the array-style TupleTable data structure with a simple List of
TupleTableSlot nodes.  This eliminates the need to count in advance
how many Slots will be needed, which seems more than worth the small
increase in the amount of palloc traffic during executor startup.

The ExecCountSlots infrastructure is now all dead code, but I'll remove it
in a separate commit for clarity.

Per a comment from Robert Haas.

15 years agoMake libpq reject non-numeric and out-of-range port numbers with a suitable
Tom Lane [Sun, 27 Sep 2009 03:43:10 +0000 (03:43 +0000)]
Make libpq reject non-numeric and out-of-range port numbers with a suitable
error message, rather than blundering on and failing with something opaque.

Sam Mason

15 years agoSync psql's scanner with recent changes in backend scanner's flex rules.
Tom Lane [Sun, 27 Sep 2009 03:27:24 +0000 (03:27 +0000)]
Sync psql's scanner with recent changes in backend scanner's flex rules.
Marko Kreen, Tom Lane

15 years agoOoops, fix to Genbki.pm for ROWTYPE_OID wasn't quite right. Also, make a few
Tom Lane [Sun, 27 Sep 2009 02:14:04 +0000 (02:14 +0000)]
Ooops, fix to Genbki.pm for ROWTYPE_OID wasn't quite right.  Also, make a few
spacing tweaks so it produces exactly the same output as genbki.sh.

15 years agoSimplify the bootstrap (BKI) code by getting rid of a useless table of all
Tom Lane [Sun, 27 Sep 2009 01:32:11 +0000 (01:32 +0000)]
Simplify the bootstrap (BKI) code by getting rid of a useless table of all
the strings seen during the bootstrap run.  There might have been some
actual point to doing that, many years ago, but as far as I can see the only
value now is to conserve a bit of memory.  Even if we cared about wasting
a megabyte or so during the initdb run, it'd be far more effective to
arrange to release memory at the end of each BKI command, instead of
intentionally hanging onto strings that might never be used again.
Not maintaining the table probably makes it faster too; but the main point
of this  is to get rid of a couple hundred lines of unnecessary and
rather crufty code.

15 years agoHmm, seems a lot of the buildfarm is running versions of awk that
Tom Lane [Sat, 26 Sep 2009 23:22:48 +0000 (23:22 +0000)]
Hmm, seems a lot of the buildfarm is running versions of awk that
don't have gensub().  Use sub() instead, tedious though it be.

15 years agoRevert my ill-considered change that made formrdesc not insert the correct
Tom Lane [Sat, 26 Sep 2009 23:08:22 +0000 (23:08 +0000)]
Revert my ill-considered change that made formrdesc not insert the correct
relation rowtype OID into the relcache entries it builds.  This ensures
that catcache copies of the relation tupdescs will be fully correct.
While the deficiency doesn't seem to have any effect in the current
sources, we have been bitten by not-quite-right catcache tupdescs before,
so it seems like a good idea to maintain the rule that they should be right.

15 years agoExtend the BKI infrastructure to allow system catalogs to be given
Tom Lane [Sat, 26 Sep 2009 22:42:03 +0000 (22:42 +0000)]
Extend the BKI infrastructure to allow system catalogs to be given
hand-assigned rowtype OIDs, even when they are not "bootstrapped" catalogs
that have handmade type rows in pg_type.h.  Give pg_database such an OID.
Restore the availability of C macros for the rowtype OIDs of the bootstrapped
catalogs.  (These macros are now in the individual catalogs' .h files,
though, not in pg_type.h.)

This commit doesn't do anything especially useful by itself, but it's
necessary infrastructure for reverting some ill-considered changes in
relcache.c.

15 years agoFix RelationCacheInitializePhase2 (Phase3, in HEAD) to cope with the
Tom Lane [Sat, 26 Sep 2009 18:24:49 +0000 (18:24 +0000)]
Fix RelationCacheInitializePhase2 (Phase3, in HEAD) to cope with the
possibility of shared-inval messages causing a relcache flush while it tries
to fill in missing data in preloaded relcache entries.  There are actually
two distinct failure modes here:

1. The flush could delete the next-to-be-processed cache entry, causing
the subsequent hash_seq_search calls to go off into the weeds.  This is
the problem reported by Michael Brown, and I believe it also accounts
for bug #5074.  The simplest fix is to restart the hashtable scan after
we've read any new data from the catalogs.  It appears that pre-8.4
branches have not suffered from this failure, because by chance there were
no other catalogs sharing the same hash chains with the catalogs that
RelationCacheInitializePhase2 had work to do for.  However that's obviously
pretty fragile, and it seems possible that derivative versions with
additional system catalogs might be vulnerable, so I'm back-ing this
part of the fix anyway.

2. The flush could delete the *current* cache entry, in which case the
pointer to the newly-loaded data would end up being stored into an
already-deleted Relation struct.  As long as it was still deleted, the only
consequence would be some  space in CacheMemoryContext.  But it seems
possible that the Relation struct could already have been recycled, in
which case this represents a hard-to-reproduce clobber of cached data
structures, with unforeseeable consequences.  The fix here is to pin the
entry while we work on it.

In passing, also change RelationCacheInitializePhase2 to Assert that
formrdesc() set up the relation's cached TupleDesc (rd_att) with the
correct type OID and hasoids values.  This is more appropriate than
silently updating the values, because the original tupdesc might already
have been copied into the catcache.  However this part of the  is
not in HEAD because it fails due to some questionable recent changes in
formrdesc :-(.  That will be cleaned up in a subsequent .

15 years agoMinor code correction on query cancel
Simon Riggs [Sat, 26 Sep 2009 09:42:46 +0000 (10:42 +0100)]
Minor code correction on query cancel

15 years agoFurther changes to ensure cancelation correct
Simon Riggs [Sat, 26 Sep 2009 09:37:54 +0000 (10:37 +0100)]
Further changes to ensure cancelation correct

15 years agoPrevent isolated second surrogate in U& syntax
Peter Eisentraut [Fri, 25 Sep 2009 21:13:06 +0000 (21:13 +0000)]
Prevent isolated second surrogate in U& syntax

15 years agoRemove backup states from Unicode escapes
Peter Eisentraut [Fri, 25 Sep 2009 20:51:37 +0000 (20:51 +0000)]
Remove backup states from Unicode escapes 

15 years agoCONFLICT_MODE_ERROR_IF_NOT_IDLE must be treated as CONFLICT_MODE_ERROR if we still...
Simon Riggs [Fri, 25 Sep 2009 20:19:06 +0000 (21:19 +0100)]
CONFLICT_MODE_ERROR_IF_NOT_IDLE must be treated as CONFLICT_MODE_ERROR if we still have a snapshot registered. Right now that equates to CONFLICT_MODE_FATAL though that may change in the future.

15 years agoPrevent LOCK TABLE during recovery and update docs accordingly.
Simon Riggs [Fri, 25 Sep 2009 20:06:46 +0000 (21:06 +0100)]
Prevent LOCK TABLE during recovery and update docs accordingly.

15 years agoCorrected logic in XidInMVCCSnapshot()
Simon Riggs [Fri, 25 Sep 2009 18:23:14 +0000 (19:23 +0100)]
Corrected logic in XidInMVCCSnapshot()

15 years agoUpdated log message and docs caveat about delayed start of hot standby queries.
Simon Riggs [Fri, 25 Sep 2009 12:51:00 +0000 (13:51 +0100)]
Updated log message and docs caveat about delayed start of hot standby queries.

15 years agoDocs changes, mostly typos and grammar correction. Many from Heikki 21 Sep
Simon Riggs [Fri, 25 Sep 2009 12:21:07 +0000 (13:21 +0100)]
Docs changes, mostly typos and grammar correction. Many from Heikki 21 Sep

15 years agoRemove some unused code from older version of HS per Heikki, 21 Sep
Simon Riggs [Fri, 25 Sep 2009 11:58:33 +0000 (12:58 +0100)]
Remove some unused code from older version of HS per Heikki, 21 Sep

15 years agoClarify Hot Standby processing for GIN and GIST indexes by more descriptive comments.
Simon Riggs [Fri, 25 Sep 2009 11:47:15 +0000 (12:47 +0100)]
Clarify Hot Standby processing for GIN and GIST indexes by more descriptive comments.

15 years agoRevoke changes to WAL_DEBUG per Jeff Janes. Separate to implement similar chang...
Simon Riggs [Fri, 25 Sep 2009 11:35:33 +0000 (12:35 +0100)]
Revoke changes to WAL_DEBUG per Jeff Janes. Separate  to implement similar changes later.

15 years agoHot Standby 0.2.1 as submitted Sept 15
Simon Riggs [Fri, 25 Sep 2009 11:30:39 +0000 (12:30 +0100)]
Hot Standby  0.2.1 as submitted Sept 15

15 years agoImprove example for DO, per Petr Jelinek.
Tom Lane [Wed, 23 Sep 2009 15:41:51 +0000 (15:41 +0000)]
Improve example for DO, per Petr Jelinek.

15 years agoUnicode escapes in E'...' strings
Peter Eisentraut [Tue, 22 Sep 2009 23:52:53 +0000 (23:52 +0000)]
Unicode escapes in E'...' strings

Author: Marko Kreen <[email protected]>

15 years agoImplement the DO statement to support execution of PL code without having
Tom Lane [Tue, 22 Sep 2009 23:43:43 +0000 (23:43 +0000)]
Implement the DO statement to support execution of PL code without having
to create a function for it.

Procedural languages now have an additional entry point, namely a function
to execute an inline code block.  This seemed a better design than trying
to hide the transient-ness of the code from the PL.  As of this , only
plpgsql has an inline handler, but probably people will soon write handlers
for the other standard PLs.

In passing, remove the long-dead LANCOMPILER option of CREATE LANGUAGE.

Petr Jelinek

15 years agoFix crash if a DROP is attempted on an internally-dependent object.
Tom Lane [Tue, 22 Sep 2009 15:46:35 +0000 (15:46 +0000)]
Fix crash if a DROP is attempted on an internally-dependent object.
Introduced in 8.4 rewrite of dependency.c.
Per bug #5072 from Amit Khandekar.

15 years agoSurrogate pair support for U& string and identifier syntax
Peter Eisentraut [Mon, 21 Sep 2009 22:22:07 +0000 (22:22 +0000)]
Surrogate pair support for U& string and identifier syntax

This is mainly to make the functionality consistent with the proposed \u
escape syntax.

15 years agofsync test files
Bruce Momjian [Mon, 21 Sep 2009 20:20:56 +0000 (20:20 +0000)]
fsync test files

Prevent creation of 16GB files during fsync testing; only create 16MB
files;  back to 8.4.X.

15 years agoDefine a new, more extensible syntax for COPY options.
Tom Lane [Mon, 21 Sep 2009 20:10:21 +0000 (20:10 +0000)]
Define a new, more extensible syntax for COPY options.

This is intentionally similar to the recently revised syntax for EXPLAIN
options, ie, (name value, ...).  The old syntax is still supported for
backwards compatibility, but we intend that any options added in future
will be provided only in the new syntax.

Robert Haas, Emmanuel Cecchet

15 years agoAllow plpgsql IN parameters to be assigned to. Since the parameters are just
Tom Lane [Sun, 20 Sep 2009 01:53:32 +0000 (01:53 +0000)]
Allow plpgsql IN parameters to be assigned to.  Since the parameters are just
preinitialized local variables, this does not affect the function's semantics
as seen by callers; allowing assignment simply avoids the need to create more
local variables in some cases.  In any case we were being rather inconsistent
since only scalar parameters were getting marked constant.

No documentation change, since parameters were never documented as being
marked constant anyway.

Steve Prentice

15 years agoRemove a couple hundred lines of ugly and tedious-to-maintain code by not
Tom Lane [Sat, 19 Sep 2009 21:51:21 +0000 (21:51 +0000)]
Remove a couple hundred lines of ugly and tedious-to-maintain code by not
trying to parse COPY options exactly in psql's \copy support.  Instead,
just send the options as-is and let the backend sort it out.

Emmanuel Cecchet

15 years agosql_help.c needs to be cvsignore'd.
Tom Lane [Sat, 19 Sep 2009 18:50:18 +0000 (18:50 +0000)]
sql_help.c needs to be cvsignore'd.

15 years agoRename new subroutine, per discussion with Robert Haas.
Tom Lane [Sat, 19 Sep 2009 17:48:09 +0000 (17:48 +0000)]
Rename new subroutine, per discussion with Robert Haas.

15 years agoMake the placeholder naming in the synopses of the SQL help more consistent
Peter Eisentraut [Sat, 19 Sep 2009 10:23:27 +0000 (10:23 +0000)]
Make the placeholder naming in the synopses of the SQL help more consistent

15 years agoFix MSVC build breakage from psql help changes. Per Josh Williams.
Andrew Dunstan [Sat, 19 Sep 2009 05:56:50 +0000 (05:56 +0000)]
Fix MSVC build breakage from psql help changes. Per Josh Williams.

15 years agoA bit more wordsmithing on the COPY CSV NULL business.
Tom Lane [Fri, 18 Sep 2009 20:01:13 +0000 (20:01 +0000)]
A bit more wordsmithing on the COPY CSV NULL business.

15 years agoMarginal code cleanup in joinpath.c: factor out clause variable-membership
Tom Lane [Fri, 18 Sep 2009 17:24:51 +0000 (17:24 +0000)]
Marginal code cleanup in joinpath.c: factor out clause variable-membership
tests into a small common subroutine, and eliminate an unnecessary difference
in the order in which conditions are tested.  Per a comment from Robert Haas.

15 years agoFix incorrect arguments for gist_box_penalty call. The bug could be observed
Teodor Sigaev [Fri, 18 Sep 2009 14:01:56 +0000 (14:01 +0000)]
Fix incorrect arguments for gist_box_penalty call. The bug could be observed
only for secondary page split (i.e. for non-first columns of index)

  by Paul Ramsey <[email protected]>

15 years agoAdded by Bernd Helmle <[email protected]> that adds a low level
Michael Meskes [Fri, 18 Sep 2009 13:13:32 +0000 (13:13 +0000)]
Added  by Bernd Helmle <[email protected]> that adds a low level
function that returns the current transaction status.

15 years agoEasier to translate psql help
Peter Eisentraut [Fri, 18 Sep 2009 05:00:42 +0000 (05:00 +0000)]
Easier to translate psql help

Instead of requiring translators to translate the entire SQL command
synopses, change create_help.pl to only require them to translate the
placeholders, and paste those into the synopsis using a printf mechanism.
Make some small updates to the markup to make it easier to parse.

Note: This causes msgmerge of gettext 0.17 to segfault.  You will need
the  from https://savannah.gnu.org/bugs/?27474 to make it work.
msgmerge usually only runs on babel.postgresql.org, however.