Thread

  1. UNIQUE constraint no longer works under 6.5.1

    Mark Dalphin <mdalphin@amgen.com> — 1999-08-13T22:57:23Z

    ============================================================================
                            POSTGRESQL BUG REPORT TEMPLATE
    ============================================================================
    
    
    Your name               :       Mark Dalphin
    Your email address      :       mdalphin@amgen.com
    
    
    System Configuration
    ---------------------
      Architecture (example: Intel Pentium)         :  SGI Octane
    
      Operating System (example: Linux 2.0.26 ELF)  :  Irix 6.5
    
      PostgreSQL version (example: PostgreSQL-6.5.1):   PostgreSQL-6.5.1
    
      Compiler used (example:  gcc 2.8.0)           :   native cc
    
    
    Please enter a FULL description of your problem:
    ------------------------------------------------
    
    Using the UNIQUE constraint in a TABLE definition no longer does anything.
    
    Please describe a way to repeat the problem.   Please try to provide a
    concise reproducible example, if at all possible:
    ----------------------------------------------------------------------
    
    The following is the output from my using '\i' to read in my SQL. Notice
    that there is no longer any comment about creating an index to perform
    the UNIQUE constraint on the field, 'Login'.
    
    Testing with INSERT confirms that I can add duplicates.
    
    CREATE SEQUENCE mkPersonID;
    CREATE
    
    CREATE TABLE Person (
            PersonID int PRIMARY KEY DEFAULT nextval('mkPersonID'),
            DateAdded timestamp             -- Date user added to system
                    NOT NULL DEFAULT getTimeStamp(),
            Login char(40) UNIQUE NOT NULL, -- User's NT Login name
            CONSTRAINT validLogin CHECK (RTrim(Login) <> '')
    );
    NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'person_pkey' for
    table 'person'
    CREATE
    
    If you know how this problem might be fixed, list the solution below:
    ---------------------------------------------------------------------
    
    
    --
    Mark Dalphin                          email: mdalphin@amgen.com
    Mail Stop: 29-2-A                     phone: +1-805-447-4951 (work)
    One Amgen Center Drive                       +1-805-375-0680 (home)
    Thousand Oaks, CA 91320                 fax: +1-805-499-9955 (work)