Re: identify Tables without primary keys - postgres

From: Rodrigo Gonzalez <rjgonzale(at)estrads(dot)com(dot)ar>
To: akp geek <akpgeek(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: identify Tables without primary keys - postgres
Date: 2010-01-15 16:45:26
Message-ID: 1263573926.1876.13.camel@rgonzale-laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Check
http://petereisentraut.blogspot.com/2009/07/how-to-find-all-tables-without-primary.html

On Fri, 2010-01-15 at 11:39 -0500, akp geek wrote:
> Dear all -
>
> I have the following query to find the tables with
> primary keys. can you please help me finding the tables without
> primary key.
>
> select
> distinct x.table_name,
> from
> information_schema.constraint_column_usage x,
> pg_constraint b
> where
> b.contype='p' and
> x.constraint_name=b.conname
>
> Regards
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message DURAND Benoît 2010-01-15 16:54:49 RE : Creation of tablespaces
Previous Message akp geek 2010-01-15 16:39:25 identify Tables without primary keys - postgres