On Tuesday, July 3, 2018, Rafal Pietrak <ra...@ztk-rp.eu> wrote: > > ERROR: there is no unique constraint matching given keys for referenced > table "test2" > ---------------------------- > > I cannot see any reasons why this functionality is blocked. > > In particular, contrary to what the ERROR says, the target table *does > have* a "unique constraint matching given keys", admittedly only > partial. >
You are making the common error of confusing the distinct concepts of constraints and indexs. Table constraints cannot be partial by definition, and are a logical concept constraining the data model. Indexes are physical objects that only aid in the execution of queries. The only crossover is that the implementation of a unique table constraint uses a full unique index as an implementation detail. The error says 'constraint' and indeed you have nit defined a relevant constraint in your schema, just indexes. David J.