Hi,

there's a paragraph in the ALTER TABLE reference page that reads:

DROP CONSTRAINT

    This form drops constraints on a table. Currently, constraints on tables
    are not required to have unique names, so there may be more than one
    constraint matching the specified name. All matching constraints will be
    dropped. 

To my knowledge, it is no longer possible to create constraints with the
same name for the same relation. When you create a constraint and specify
the same name explictly, an error is raised. Implicit constraint creation
won't choose an existing name either and up to now you could not rename a
constraint. Renaming works with the patch I sent in a few hours ago but this
patch as well won't allow constraints with identical names on the same
relation.

The attached patch thus removes the note in the docs.


Joachim
Index: doc/src/sgml/ref/alter_table.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v
retrieving revision 1.81
diff -u -c -r1.81 alter_table.sgml
*** doc/src/sgml/ref/alter_table.sgml   24 Aug 2005 17:24:19 -0000      1.81
--- doc/src/sgml/ref/alter_table.sgml   5 Dec 2005 12:15:45 -0000
***************
*** 183,192 ****
      <term><literal>DROP CONSTRAINT</literal></term>
      <listitem>
       <para>
!       This form drops constraints on a table.
!       Currently, constraints on tables are not required to have unique
!       names, so there may be more than one constraint matching the specified
!       name.  All matching constraints will be dropped.
       </para>
      </listitem>
     </varlistentry>
--- 183,189 ----
      <term><literal>DROP CONSTRAINT</literal></term>
      <listitem>
       <para>
!       This form drops the specified constraint on a table.
       </para>
      </listitem>
     </varlistentry>
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to