Search Postgresql Archives

Re: Querying database for table pk - better way?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/5/07, Josh Trutwin <josh@xxxxxxxxxxxxxxxxxxx> 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'

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux