Thread: constraint is not dropped when table is dropped (maybe php related???)

constraint is not dropped when table is dropped (maybe php related???)

From
Mary Anderson
Date:
Hi all,

     I do the following  :

           DROP TABLE IF EXISTS xprod;
           CREATE TABLE xprod( dm1   INTEGER
                                                    d5     INTEGER
                                                   value  DOUBLE);
           ALTER TABLE xprod
           ADD CONSTRAINT xprod_p_key PRIMARY KEY (dm1,d5)

      If I run this once, everything is OK.  (Actually these are
postresql statements extracted from a php script)
      If I rerun this script I get an error
           'relation "xprod_p_key" already exists.

      I have tried to replicate this with straight postgresql statements
and find that constraints are dropped when the table
      is dropped.  Any clues as to what is happening would be appreciated.

Mary