Re: [GENERAL] How to tell PostgreSQL about a relationship

2008-10-26 Thread Niklas Johansson
On 26 okt 2008, at 10.44, Thomas wrote: Currently I have 3 tables: Product(id, title, price) Item(id, product_id, order_id, quantity) Order(id, amount, paid) So how do I tell PgSQL that when I remove a given order, it should remove all associated items also? Use a foreign key constraint with

Re: [GENERAL] How to tell PostgreSQL about a relationship

2008-10-26 Thread Thomas
Super! Thank you Hubert and Niklas. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] How to tell PostgreSQL about a relationship

2008-10-26 Thread hubert depesz lubaczewski
On Sun, Oct 26, 2008 at 10:44:29AM +0100, Thomas wrote: > In pgAdmin I have removed a few order entries, but the items > associated to them are still here, now I have zombie items floating > around that don't belong to any order. So how do I tell PgSQL that > when I remove a given order, it should