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

Re: Finding the Table for Check Constraint

From: "Tim Bruce" <pdxpug(at)tbruce(dot)com>
To: "Brent Dombrowski" <brent(dot)dombrowski(at)gmail(dot)com>
Cc: "Postgresql PDX_Users" <pdxpug(at)postgresql(dot)org>
Subject: Re: Finding the Table for Check Constraint
Date: 2012-05-08 17:22:48
Message-ID: 460990fc649b8101580d88565fec915c.squirrel@sm.tbruce.com (view raw or flat)
Thread:
Lists: pdxpug
On Tue, May 8, 2012 10:08, Brent Dombrowski wrote:
> I need to update some check constraints for a postgis migration. I can
> find the constraints I'm interested in the the pg_constraint catalog.
> However, I'm having a hell of a time trying to get the table name
> associated with the constraint. I can get the schema name and the column
> is included in the source, but the table is eluding me. Anyone have a clue
> they could send my way?
>
> Brent D.
>
>
> --
> Sent via pdxpug mailing list (pdxpug(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pdxpug
>

Look at the conrelid column in pg_constraint and compare it to the oid
column of pg_class to pull the relname field.

Tim
-- 
Timothy J. Bruce



In response to

pdxpug by date

Next:From: Brent DombrowskiDate: 2012-05-08 17:41:09
Subject: Re: Finding the Table for Check Constraint
Previous:From: David E. WheelerDate: 2012-05-08 17:21:43
Subject: Re: Finding the Table for Check Constraint

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