~ubuntu-branches/ubuntu/precise/postgresql-9.1/precise-security

« back to all changes in this revision

Viewing changes to src/backend/utils/adt/pgstatfuncs.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-07-14 18:39:43 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110714183943-eqlbsrurk6kh6lou
Tags: 9.1~beta3-1
* New upstream beta release.
  - Works around gcc 4.6.0 bug. (Closes: #633086)

  Note that this does not change the data format since Beta 2, so no need
  to dump/reload clusters.

Show diffs side-by-side

added added

removed removed

Lines of Context:
509
509
                tupdesc = CreateTemplateTupleDesc(12, false);
510
510
                TupleDescInitEntry(tupdesc, (AttrNumber) 1, "datid",
511
511
                                                   OIDOID, -1, 0);
 
512
                /* This should have been called 'pid';  can't change it. 2011-06-11 */
512
513
                TupleDescInitEntry(tupdesc, (AttrNumber) 2, "procpid",
513
514
                                                   INT4OID, -1, 0);
514
515
                TupleDescInitEntry(tupdesc, (AttrNumber) 3, "usesysid",
1536
1537
Datum
1537
1538
pg_stat_reset_shared(PG_FUNCTION_ARGS)
1538
1539
{
1539
 
        char       *target = text_to_cstring(PG_GETARG_TEXT_PP(0));
 
1540
        if (PG_ARGISNULL(0))
 
1541
                /*
 
1542
                 * Same error message as in pgstat_reset_shared_counters(),
 
1543
                 * to keep translations the same.
 
1544
                 */
 
1545
                ereport(ERROR,
 
1546
                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
 
1547
                                 errmsg("unrecognized reset target: \"%s\"", "null"),
 
1548
                                 errhint("Target must be \"bgwriter\".")));
1540
1549
 
1541
 
        pgstat_reset_shared_counters(target);
 
1550
        pgstat_reset_shared_counters(text_to_cstring(PG_GETARG_TEXT_PP(0)));
1542
1551
 
1543
1552
        PG_RETURN_VOID();
1544
1553
}