~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-07-24 16:13:59 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140724161359-uk325qfv03euxuuh
Tags: 9.3.5-0ubuntu0.14.04.1
* New upstream bug fix release: (LP: #1348176)
  - pg_upgrade: Users who upgraded to version 9.3 using pg_upgrade may have
    an issue with transaction information which causes VACUUM to eventually
    fail. These users should run the script provided in the release notes to
    determine if their installation is affected, and then take the remedy
    steps outlined there.
  - Various data integrity and other bug fixes.
  - Secure Unix-domain sockets of temporary postmasters started during make
    check.
    Any local user able to access the socket file could connect as the
    server's bootstrap superuser, then proceed to execute arbitrary code as
    the operating-system user running the test, as we previously noted in
    CVE-2014-0067. This change defends against that risk by placing the
    server's socket in a temporary, mode 0700 subdirectory of /tmp.
  - See release notes for details:
    http://www.postgresql.org/about/news/1534/
* Remove pg_regress patches to support --host=/path, obsolete with above
  upstream changes and not applicable any more.
* Drop tcl8.6 patch, applied upstream.
* Add missing logrotate test dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
        }
177
177
 
178
178
        /*
179
 
         * Prepare the canonical string to return.      GUC wants it malloc'd.
 
179
         * Prepare the canonical string to return.  GUC wants it malloc'd.
180
180
         */
181
181
        result = (char *) malloc(32);
182
182
        if (!result)
274
274
        if (pg_strncasecmp(*newval, "interval", 8) == 0)
275
275
        {
276
276
                /*
277
 
                 * Support INTERVAL 'foo'.      This is for SQL spec compliance, not
 
277
                 * Support INTERVAL 'foo'.  This is for SQL spec compliance, not
278
278
                 * because it has any actual real-world usefulness.
279
279
                 */
280
280
                const char *valueptr = *newval;
298
298
 
299
299
                /*
300
300
                 * Try to parse it.  XXX an invalid interval format will result in
301
 
                 * ereport(ERROR), which is not desirable for GUC.      We did what we
 
301
                 * ereport(ERROR), which is not desirable for GUC.  We did what we
302
302
                 * could to guard against this in flatten_set_variable_args, but a
303
303
                 * string coming in from postgresql.conf might contain anything.
304
304
                 */
374
374
        }
375
375
 
376
376
        /*
377
 
         * Prepare the canonical string to return.      GUC wants it malloc'd.
 
377
         * Prepare the canonical string to return.  GUC wants it malloc'd.
378
378
         *
379
379
         * Note: the result string should be something that we'd accept as input.
380
380
         * We use the numeric format for interval cases, because it's simpler to
381
 
         * reload.      In the named-timezone case, *newval is already OK and need not
 
381
         * reload.  In the named-timezone case, *newval is already OK and need not
382
382
         * be changed; it might not have the canonical casing, but that's taken
383
383
         * care of by show_timezone.
384
384
         */
534
534
 * We allow idempotent changes (r/w -> r/w and r/o -> r/o) at any time, and
535
535
 * we also always allow changes from read-write to read-only.  However,
536
536
 * read-only may be changed to read-write only when in a top-level transaction
537
 
 * that has not yet taken an initial snapshot.  Can't do it in a hot standby
 
537
 * that has not yet taken an initial snapshot.  Can't do it in a hot standby
538
538
 * slave, either.
539
539
 *
540
540
 * If we are not in a transaction at all, just allow the change; it means
695
695
 *
696
696
 * We can't roll back the random sequence on error, and we don't want
697
697
 * config file reloads to affect it, so we only want interactive SET SEED
698
 
 * commands to set it.  We use the "extra" storage to ensure that rollbacks
 
698
 * commands to set it.  We use the "extra" storage to ensure that rollbacks
699
699
 * don't try to do the operation again.
700
700
 */
701
701
 
971
971
show_role(void)
972
972
{
973
973
        /*
974
 
         * Check whether SET ROLE is active; if not return "none".      This is a
 
974
         * Check whether SET ROLE is active; if not return "none".  This is a
975
975
         * kluge to deal with the fact that SET SESSION AUTHORIZATION logically
976
976
         * resets SET ROLE to NONE, but we cannot set the GUC role variable from
977
977
         * assign_session_authorization (because we haven't got enough info to