Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id F13A22E3721 for ; Tue, 18 Dec 2007 05:36:51 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 43761-05 for ; Tue, 18 Dec 2007 05:36:40 -0400 (AST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by postgresql.org (Postfix) with ESMTP id A9B882E373A for ; Tue, 18 Dec 2007 05:36:43 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id j3so75613ugf.49 for ; Tue, 18 Dec 2007 01:36:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=dZIQyzkMxBeXOpFPEmqeQr+sRv+WdT/hM8XEclL+XtA=; b=pkP/u9nOt0SlnZZusUySy0PLTOgm5yXD+HJG5/SdbLsv/TpUtRRBnfl8HPOa1chvQZuqp8SE50AuWiLAFLAprP3Wh/f0WB6ke/caDGZNBp1rjDBuvxCgzM/p87vj2zffNv4X86qvy0X4IMAcJe/sEfAIUV5SOyrHg45Mqhq8AhM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=l70JqFrSUzHxf9s2nzDh3gh20Tp9fgmwkFVpSlK58dyWs0N8A38HV8GMeJR0jDDZrk/uMpr53lkHuDP+xY/VnqVDDq7eUHO0RNC7xzJkx5EieunVTeJyiyrpylnJr+fdfL6bjR3xaRm0sqTvBPIAsFatR+czwuA5Xo5mzc957tE= Received: by 10.67.23.5 with SMTP id a5mr624726ugj.8.1197970602360; Tue, 18 Dec 2007 01:36:42 -0800 (PST) Received: from ?192.168.1.33? ( [86.31.52.38]) by mx.google.com with ESMTPS id 27sm1286724ugp.19.2007.12.18.01.36.40 (version=SSLv3 cipher=RC4-MD5); Tue, 18 Dec 2007 01:36:40 -0800 (PST) Message-ID: <476794A6.8020707@enterprisedb.com> Date: Tue, 18 Dec 2007 09:36:38 +0000 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.14pre (X11/20071020) MIME-Version: 1.0 To: Tore Halset CC: pgsql-jdbc@postgresql.org Subject: Re: find foreign key name References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/130 X-Sequence-Number: 17985 Tore Halset wrote: > I want to programatically drop a foreign key constraint via jdbc. How > can I find the foreign key name for a PostgreSQL foreign key via jdbc? I > know all about the related tables and columns, but not the name of the > constraint. You can query the pg_constraint catalog table: http://www.postgresql.org/docs/8.2/interactive/catalog-pg-constraint.html There seems to be some example queries in the user comments that you might be interested. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com