On 9/5/07, Josh Trutwin <josh@trutwins.homeip.net> wrote:
> Curious if there is a better/cheaper way to get the data I'm looking
> for though?
SELECT conname
FROM pg_constraint c JOIN pg_class l ON c.conrelid = l.relfilenode
JOIN pg_namespace n ON n.OID = l.relnamespace
WHERE contype = 'p'
AND relname = '$table'
AND nspname = '$schema'