~ubuntu-branches/ubuntu/lucid/postgresql-8.4/lucid-proposed

« back to all changes in this revision

Viewing changes to src/backend/catalog/pg_constraint.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:
8
8
 *
9
9
 *
10
10
 * IDENTIFICATION
11
 
 *        $PostgreSQL: pgsql/src/backend/catalog/pg_constraint.c,v 1.44 2009/01/01 17:23:37 momjian Exp $
 
11
 *        $PostgreSQL: pgsql/src/backend/catalog/pg_constraint.c,v 1.45 2009/06/11 14:48:55 momjian Exp $
12
12
 *
13
13
 *-------------------------------------------------------------------------
14
14
 */
600
600
        con = (Form_pg_constraint) GETSTRUCT(tuple);
601
601
 
602
602
        /*
603
 
         * We need to check whether the name is already in use --- note that
604
 
         * there currently is not a unique index that would catch this.
 
603
         * We need to check whether the name is already in use --- note that there
 
604
         * currently is not a unique index that would catch this.
605
605
         */
606
606
        if (OidIsValid(con->conrelid) &&
607
607
                ConstraintNameIsUsed(CONSTRAINT_RELATION,
610
610
                                                         newname))
611
611
                ereport(ERROR,
612
612
                                (errcode(ERRCODE_DUPLICATE_OBJECT),
613
 
                                 errmsg("constraint \"%s\" for relation \"%s\" already exists",
614
 
                                                newname, get_rel_name(con->conrelid))));
 
613
                           errmsg("constraint \"%s\" for relation \"%s\" already exists",
 
614
                                          newname, get_rel_name(con->conrelid))));
615
615
        if (OidIsValid(con->contypid) &&
616
616
                ConstraintNameIsUsed(CONSTRAINT_DOMAIN,
617
617
                                                         con->contypid,