Skip site navigation (1) Skip section navigation (2)

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

From: Mary Anderson <maryfran(at)demog(dot)berkeley(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: constraint is not dropped when table is dropped (maybe php related???)
Date: 2009-04-03 00:38:35
Message-ID: 49D55A8B.1010306@demog.berkeley.edu (view raw or flat)
Thread:
Lists: pgsql-novice
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
                 

pgsql-novice by date

Next:From: Mary AndersonDate: 2009-04-03 00:58:10
Subject: Re: constraint is not dropped when table is dropped
Previous:From: Robert SchnabelDate: 2009-04-02 16:13:59
Subject: WAL and TMP directory locations

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group