EPUB | CHM | PDF

Creating a Many-to-Many Reference

Top Previous Next

A many-to-many reference can relate one record in either table to many records in the other table.

The only way to create many-to-many (N:M) reference between two tables in PostgreSQL is using an intermediate table, which records set association between primary keys of first table and primary keys of second table.

Database Designer for PostgreSQL helps you set many-to-many reference between two tables easily:

§it automatically creates intermediate table with proper columns and indexes;

§and then creates regular references between columns of intermediate table and primary keys of tables being linked.

Remember, that tables being linked must have primary key.

How to create...

To create a many-to-many reference between two tables, click the icon-new-nm-reference icon on the Palette toolbar. Your mouse cursor will change its appearance. Then consistently click two tables you want to link with many-to-many reference.

See also:
Creating a Reference