Given a country table and an order table:
CREATE TABLE g.country
(
-- inherited from table g.standard: oid uuid NOT NULL,
-- ... some more columns inherited...
lisocode integer NOT NULL, -- Numeric ISO 3166 code
szisoalpha2 character varying(2), -- The 2 letter country code
szisoalpha3 char
We run two separate databases which are synchronized through our own
replication system (two master databases, so we use our own trigger based
methods). Let's call the two databases "main" and "remote".
>From time to time we get constraint violations on sorting fields classified
>UNIQUE when us