~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-updates

« back to all changes in this revision

Viewing changes to src/backend/commands/sequence.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-06-14 09:53:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110614095329-kerawur7tb6p8s71
Tags: 9.1~beta2-1
* New upstream beta release.
* Drop 03-cmsgcred-size.patch, fixed upstream.
* debian/postgresql-9.1.install: Install new pg_basebackup translations.
* debian/control: Fix the server-dev dependency to p-common to also work for
  backports.
* debian/watch: Fix for beta versions.
* debian/copyright: Add pointers to GPL and Artistic licenses for the Perl
  terms.
* debian/postgresql-9.1.preinst: Fail the package upgrade early when
  upgrading from beta-1, as the DB format changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1076
1076
        Assert(ItemIdIsNormal(lp));
1077
1077
        tuple.t_data = (HeapTupleHeader) PageGetItem(page, lp);
1078
1078
 
 
1079
        /*
 
1080
         * Previous releases of Postgres neglected to prevent SELECT FOR UPDATE on
 
1081
         * a sequence, which would leave a non-frozen XID in the sequence tuple's
 
1082
         * xmax, which eventually leads to clog access failures or worse. If we
 
1083
         * see this has happened, clean up after it.  We treat this like a hint
 
1084
         * bit update, ie, don't bother to WAL-log it, since we can certainly do
 
1085
         * this again if the update gets lost.
 
1086
         */
 
1087
        if (HeapTupleHeaderGetXmax(tuple.t_data) != InvalidTransactionId)
 
1088
        {
 
1089
                HeapTupleHeaderSetXmax(tuple.t_data, InvalidTransactionId);
 
1090
                tuple.t_data->t_infomask &= ~HEAP_XMAX_COMMITTED;
 
1091
                tuple.t_data->t_infomask |= HEAP_XMAX_INVALID;
 
1092
                SetBufferCommitInfoNeedsSave(*buf);
 
1093
        }
 
1094
 
1079
1095
        seq = (Form_pg_sequence) GETSTRUCT(&tuple);
1080
1096
 
1081
1097
        /* this is a handy place to update our copy of the increment */