Обсуждение: ALTER TABLE ... DROP CONSTRAINT

Поиск
Список
Период
Сортировка

ALTER TABLE ... DROP CONSTRAINT

От
Elielson Fontanezi
Дата:
Hi all!
 
    Who can tell me what postgres version supports ALTER TABLE... DROP CONSTRAINT without
the need of droping the table to remove a simple coinstraint. (link)

                                   >\\\!/<     55 11 5080 9283
                                   !_"""_!     Elielson Fontanezi
                                   (O) (o)     PRODAM - Technical Support Analyst
-------------------------------oOOO--(_)--OOOo-----------------------------------
    
Success usually comes to those who are too busy to be looking for it.
                           
oooo0          0oooo
---------------------------(    )----------(    )--------------------------------
                            \  (            )  /
                             \_/            \_/

 

Re: ALTER TABLE ... DROP CONSTRAINT

От
Andrew Gould
Дата:
--- Elielson Fontanezi <ElielsonF@prodam.sp.gov.br>
wrote:
> Hi all!
>
>     Who can tell me what postgres version supports
> ALTER TABLE... DROP
> CONSTRAINT without
> the need of droping the table to remove a simple
> coinstraint. (link)
>
> Elielson Fontanezi
> PRODAM - Technical Support
> Analyst

I performed that task yesterday using PostgreSQL
7.3.3:

Alter table mkt drop constraint mkt_pkey;

I don't know if it's supported in earlier versions.

Best regards,

Andrew Gould

Re: ALTER TABLE ... DROP CONSTRAINT

От
Rod Taylor
Дата:
I think you can do some constraints in 7.2, but 7.3 will allow dropping
them all in that fashion.

On Wed, 2003-07-30 at 11:52, Elielson Fontanezi wrote:
> Hi all!
>
>     Who can tell me what postgres version supports ALTER TABLE... DROP
> CONSTRAINT without
> the need of droping the table to remove a simple coinstraint. (link)
>
>                                    >\\\!/<     55 11 5080 9283
>                                    !_"""_!     Elielson Fontanezi
>                                    (O) (o)     PRODAM - Technical
> Support Analyst
> -------------------------------oOOO--(_)--OOOo-----------------------------------
>      Success usually comes to those who are too busy to be looking for
> it.
>                             oooo0          0oooo
> ---------------------------(    )----------(
> )--------------------------------
>                             \  (            )  /
>                              \_/            \_/
>
>
>

Вложения

Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

От
Rajesh Kumar Mallah
Дата:
if the constraint are named $1 $2 etc you will need to quote them eg

ALTER TABLE xyz DROP CONSTRAINT "$1" ;

in some version you may require

ALTER TABLE xyz DROP CONSTRAINT "$1"  RESTRICT;

What is ur version btw?

try to post the table structure also.

regds mallah.

Elielson Fontanezi wrote:

> Hi all!
>
>     Who can tell me what postgres version supports ALTER TABLE... DROP
> CONSTRAINT without
> the need of droping the table to remove a simple coinstraint. (link)
>
>                                    >\\\!/<     55 11 5080 9283
>                                    !_"""_!     Elielson Fontanezi
>                                    (O) (o)     PRODAM - Technical
> Support Analyst
> -------------------------------oOOO--(_)--OOOo-----------------------------------
>      Success usually comes to those who are too busy to be looking for it.
>                             oooo0          0oooo
> ---------------------------(    )----------(
> )--------------------------------
>                             \  (            )  /
>                              \_/            \_/
>
>




Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

От
"Chad Thompson"
Дата:
 
Hi all!
 
    Who can tell me what postgres version supports ALTER TABLE... DROP CONSTRAINT without
the need of droping the table to remove a simple coinstraint. (link)

                                   >\\\!/<     55 11 5080 9283
                                   !_"""_!     Elielson Fontanezi
                                   (O) (o)     PRODAM - Technical Support Analyst
-------------------------------oOOO--(_)--OOOo-----------------------------------
    
Success usually comes to those who are too busy to be looking for it.
                           
oooo0          0oooo
---------------------------(    )----------(    )--------------------------------
                            \  (            )  /
                             \_/            \_/

 
7.3 supports the drop constraint.  The only exception begin if you upgraded your database.  It keeps the existing trigger like constraints if youve moved from 7.1 or 7.2.  But these triggers can be dropped as well.
 
HTH
Chad
 
P.S. Great signature! :-)

Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

От
"George Weaver"
Дата:
It works in 7.3.2.
 
George
----- Original Message -----
Sent: Wednesday, July 30, 2003 10:52 AM
Subject: [SQL] ALTER TABLE ... DROP CONSTRAINT

Hi all!
 
    Who can tell me what postgres version supports ALTER TABLE... DROP CONSTRAINT without
the need of droping the table to remove a simple coinstraint. (link)

                                   >\\\!/<     55 11 5080 9283
                                   !_"""_!     Elielson Fontanezi
                                   (O) (o)     PRODAM - Technical Support Analyst
-------------------------------oOOO--(_)--OOOo-----------------------------------
    
Success usually comes to those who are too busy to be looking for it.
                           
oooo0          0oooo
---------------------------(    )----------(    )--------------------------------
                            \  (            )  /
                             \_/            \_/