~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 *
10
10
 *
11
11
 * IDENTIFICATION
12
 
 *        $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.48 2009/01/01 17:23:37 momjian Exp $
 
12
 *        $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.49 2009/06/11 14:48:55 momjian Exp $
13
13
 *
14
14
 * DESCRIPTION
15
15
 *        The "DefineFoo" routines take the parse tree and pick out the
173
173
         *
174
174
         * transtype can't be a pseudo-type, since we need to be able to store
175
175
         * values of the transtype.  However, we can allow polymorphic transtype
176
 
         * in some cases (AggregateCreate will check).  Also, we allow "internal"
 
176
         * in some cases (AggregateCreate will check).  Also, we allow "internal"
177
177
         * for functions that want to pass pointers to private data structures;
178
 
         * but allow that only to superusers, since you could crash the system
179
 
         * (or worse) by connecting up incompatible internal-using functions
180
 
         * in an aggregate.
 
178
         * but allow that only to superusers, since you could crash the system (or
 
179
         * worse) by connecting up incompatible internal-using functions in an
 
180
         * aggregate.
181
181
         */
182
182
        transTypeId = typenameTypeId(NULL, transType, NULL);
183
183
        if (get_typtype(transTypeId) == TYPTYPE_PSEUDO &&
184
184
                !IsPolymorphicType(transTypeId))
185
185
        {
186
186
                if (transTypeId == INTERNALOID && superuser())
187
 
                        /* okay */ ;
 
187
                         /* okay */ ;
188
188
                else
189
189
                        ereport(ERROR,
190
190
                                        (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),