From jkanter@virginia.edu Mon Sep 13 15:31:00 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DA3F9329E69 for ; Mon, 13 Sep 2004 16:31:00 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67260-07 for ; Mon, 13 Sep 2004 15:30:56 +0000 (GMT) Received: from fork7.mail.virginia.edu (fork7.mail.Virginia.EDU [128.143.2.177]) by svr1.postgresql.org (Postfix) with ESMTP id 23799329E68 for ; Mon, 13 Sep 2004 16:30:55 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by fork7.mail.virginia.edu (Postfix) with ESMTP id 2888A1F5167 for ; Mon, 13 Sep 2004 11:30:52 -0400 (EDT) Received: from fork7.mail.virginia.edu ([127.0.0.1]) by localhost (fork7.mail.virginia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 21486-06 for ; Mon, 13 Sep 2004 11:30:52 -0400 (EDT) Received: from virginia.edu (d-137-133-131.bootp.Virginia.EDU [137.54.133.131]) by fork7.mail.virginia.edu (Postfix) with ESMTP id E63CC1F4FE2 for ; Mon, 13 Sep 2004 11:30:51 -0400 (EDT) Message-ID: <4145BD2A.7060502@virginia.edu> Date: Mon, 13 Sep 2004 11:30:50 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Postgres Admin List Subject: dropping a table constraint Content-Type: multipart/alternative; boundary="------------000008030201010607070809" X-UVA-Virus-Scanned: by amavisd-new at fork7.mail.virginia.edu X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.4 tagged_above=0.0 required=5.0 tests=HTML_30_40, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: * X-Archive-Number: 200409/111 X-Sequence-Number: 14814 This is a multi-part message in MIME format. --------------000008030201010607070809 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I needed to add a FK constraint to a table where one was forgotten. I found an add constraint command and used it: ALTER TABLE file_info add foreign key (al_fk) references arraylayout(al_pk); However, I wanted to name the constraint. It now looks like this: $1 FOREIGN KEY (al_fk) REFERENCES arraylayout(al_pk) ON UPDATE NO ACTION ON DELETE NO ACTION I have tried using the drop command so I could recreate it with a name but the drop command is not working. I am on version 7.3.4. can anyone tell me what I am doing wrong? I could dump and restore the entire db but do not want to if it's not necessary. Thanks Jodi -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------000008030201010607070809 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit I needed to add a FK constraint to a table where one was forgotten. I found an add constraint command and used it:

ALTER TABLE file_info add foreign key (al_fk) references arraylayout(al_pk);

However, I wanted to name the constraint. It now looks like this:

$1 FOREIGN KEY (al_fk) REFERENCES arraylayout(al_pk) ON UPDATE NO ACTION ON DELETE NO ACTION

I have tried using the drop command so I could recreate it with a name but the drop command is not working.
I am on version 7.3.4.

can anyone tell me what I am doing wrong? I could dump and restore the entire db but do not want to if it's not necessary.
Thanks
Jodi

--
_______________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu

 

--------------000008030201010607070809-- From Lwu@mxlogic.com Mon Sep 13 18:45:50 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 100D9329D86 for ; Mon, 13 Sep 2004 19:45:50 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93116-10 for ; Mon, 13 Sep 2004 18:45:43 +0000 (GMT) Received: from p03m105.mxlogic.net (p03m105.mxlogic.net [216.183.119.105]) by svr1.postgresql.org (Postfix) with SMTP id 1FAEE329DB0 for ; Mon, 13 Sep 2004 19:45:40 +0100 (BST) Received: from mxhq-exch.corp.mxlogic.com [63.78.248.11] (HELO p03m105.mxlogic.net) by p03m105.mxlogic.net (mxl_mta-1.3.8-10p4) with SMTP id 7dae5414.32163.013.p03m105.mxlogic.net; Mon, 13 Sep 2004 12:45:43 -0600 (MDT) Received: from mxhq-exch.corp.mxlogic.com [63.78.248.11] (EHLO mxhq-exch.corp.mxlogic.com) by p03m105.mxlogic.net (mxl_mta-1.3.8-10p4) with ESMTP id 651c5414.24634.048.p03m105.mxlogic.net; Mon, 13 Sep 2004 09:48:38 -0600 (MDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C499A9.203D0989" Subject: Re: dropping a table constraint Date: Mon, 13 Sep 2004 09:48:34 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ADMIN] dropping a table constraint Thread-Index: AcSZp3nxRnL8da+lTGmSvOb42XrcVQAAXmBw From: "Lee Wu" To: "Jodi Kanter" , "Postgres Admin List" X-MX-Spam: exempt X-MX-MAIL-FROM: X-MX-SOURCE-IP: [63.78.248.11] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=HTML_50_60, HTML_FONTCOLOR_UNKNOWN, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200409/112 X-Sequence-Number: 14815 This is a multi-part message in MIME format. ------_=_NextPart_001_01C499A9.203D0989 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Did you try: =20 alter table file_info drop constraint "$1"; =20 =20 -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Jodi Kanter Sent: Monday, September 13, 2004 9:31 AM To: Postgres Admin List Subject: [ADMIN] dropping a table constraint =20 I needed to add a FK constraint to a table where one was forgotten. I found an add constraint command and used it: ALTER TABLE file_info add foreign key (al_fk) references arraylayout(al_pk); However, I wanted to name the constraint. It now looks like this: $1 FOREIGN KEY (al_fk) REFERENCES arraylayout(al_pk) ON UPDATE NO ACTION ON DELETE NO ACTION I have tried using the drop command so I could recreate it with a name but the drop command is not working. I am on version 7.3.4. can anyone tell me what I am doing wrong? I could dump and restore the entire db but do not want to if it's not necessary. Thanks Jodi --=20 _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu =20 =20 ------_=_NextPart_001_01C499A9.203D0989 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable _______________________________

Did you try:

 

alter table file_info drop constraint "$1";

 

 

-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] = On Behalf Of Jodi Kanter
Sent: Monday, September 13, = 2004 9:31 AM
To: Postgres Admin List
Subject: [ADMIN] dropping a = table constraint

 

I needed to add a FK constraint to a table where one was forgotten.= I found an add constraint command and used it:

ALTER TABLE file_info add foreign key (al_fk) references arraylayout(al_pk)= ;

However, I wanted to name the constraint. It now looks like this:

$1 FOREIGN KEY (al_fk) REFERENCES arraylayout(al_pk) ON UPDATE NO ACTION ON DELETE NO ACTION

I have tried using the drop command so I could recreate it with a name but = the drop command is not working.
I am on version 7.3.4.

can anyone tell me what I am doing wrong? I could dump and restore the enti= re db but do not want to if it's not necessary.
Thanks
Jodi

-- =

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu
<= /font>

 

=00= ------_=_NextPart_001_01C499A9.203D0989--