[postgis-users] How to see the constraints generated by PostGIS

Michael Fuhr mike at fuhr.org
Wed Mar 8 10:23:07 PST 2006


On Wed, Mar 08, 2006 at 02:52:45PM -0300, Ezequias Rodrigues da Rocha wrote:
> I need to see the constraints generated by postgis. I did some shp2pg 
> and now I need to see how this constraints where defined.

In psql run "\d tablename"; if you're using some other client then
check its documentation.  Or query the system catalogs:

SELECT conname, contype, pg_get_constraintdef(oid, true)
FROM pg_constraint
WHERE conrelid = 'tablename'::regclass;

-- 
Michael Fuhr



More information about the postgis-users mailing list