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

[OT] PostgreSQL many-to-many relationship



I am trying to create a database that has a many-to-many relationship. We
can build the tables without any problems, but I am trying to find out if it
is possible to cascade delete the items in the related fields.

Tables:
a - column_1 (Primary Key)
b - column_2 (Primary Key)

c - fk_a_column_1 (Foreign key to a column_1)
    fk_b_column_2 (Foreign key to a column_2)

Is it possible to setup a relationship so that when a record in table a is
deleted its related records in b are deleted as well.

Chad





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