gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] database replication with bucardo


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] database replication with bucardo
Date: Tue, 26 Jun 2012 09:03:09 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jun 26, 2012 at 07:04:18AM +0200, Slappinjohn wrote:

If I read this query correctly it means:


select
        table_catalog,
        table_schema,
        table_name
from information_schema.tables
where
        table_schema not in ('information_schema', 'pg_catalog')
                and
        table_type = 'base table'
                and
        (
                table_catalog,
                table_schema,
                table_name
        ) not in (
                -- selects tables which have constraints other than PK or UNIQUE
                -- REGARDLESS of whether they've got PK and/or UNIQUE, too
                select
                        table_catalog,
                        table_schema,
                        table_name
                from information_schema.table_constraints
                where
                        constraint_type not in ('primary key', 'unique')
        )
;



I think one would need to do an EXCEPT on the (set of all
relevent tables) vs (set of all relevant tables with PK
and/or UNIQUE).

Maybe I am misunderstanding the query ?

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]