Re: [GENERAL] Database design confusing pg_restore, and misc pg_restore issues

2010-05-09 Thread Alban Hertroys
On 9 May 2010, at 6:49, Rick Yorgason wrote: So, your first suggestion would look like this: reginfo(order_id, product_id, reginfo1_columns, reginfo2_columns, FOREIGN KEY(order_id, product_id) REFERENCES order_items) For the sake of illustration, let's say that order_item's foreign key

[GENERAL] Database design confusing pg_restore, and misc pg_restore issues

2010-05-08 Thread Rick Yorgason
Hey everyone, I run a website that sells videogames, and different games have different registration systems, so I have a database design that goes something like this: registration_type enum('none', 'regtype1', 'regtype2') products(product_id, registration_type) order_item(order_id,

Re: [GENERAL] Database design confusing pg_restore, and misc pg_restore issues

2010-05-08 Thread Tom Lane
Rick Yorgason r...@longbowgames.com writes: In other words, (order_id, product_id) of order_item is a foreign key to either reginfo1, reginfo2, or nothing, depending on which product it is. I think you'll find that few people regard that as good database design. The works really well, until

Re: [GENERAL] Database design confusing pg_restore, and misc pg_restore issues

2010-05-08 Thread Rick Yorgason
On 08/05/2010 10:33 PM, Tom Lane wrote: Since you say that --disable-triggers doesn't help, I guess that you're applying that function not in a trigger but in a CHECK constraint? That's pretty horrid in itself: CHECK is *not* meant to enforce anything except local properties of the newly