Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4R5w-0008Jj-J1 for pgsql-docs@postgresql.org; Thu, 23 Aug 2012 06:40:44 +0000 Received: from mail-ob0-f174.google.com ([209.85.214.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4R5u-0001Mk-Vt for pgsql-docs@postgresql.org; Thu, 23 Aug 2012 06:40:43 +0000 Received: by obbuo13 with SMTP id uo13so856716obb.19 for ; Wed, 22 Aug 2012 23:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ILc8D7o58XnIZzozw2mhTUMYzXTzL0bs0iEtW6j57mk=; b=VsDnbXH9V58cEa09+SYXrp3D+Rd6ayGHyQXxz2uX1QXn04sN14gPqmEKNbm70GBUli dWVNgvq9UNwwV5MIVtbq23NG7U9vPYGzx7H1pze3lAJ7we46Lf35lKu6YSzSNShJWds3 P6KJspr4bKQBefGGQwEy3KdnDADmnM7X8h8P/wuKmRVSBhQfMt0jS/mTp9Mf+JfbCM+f IRaEDl2oWIgaO3YU7l/Mfm3ARfdVh/jlsiD/jou/sKK3Br3ZG+O1pPWgbEAhat7fTtkm jsJpKQa1YIKeEMeZjzTsRy55ThwU7rBrOmA9hOtu+OrKn/fNt1Dz8lBNx5y3C0lebX+h 7LKg== MIME-Version: 1.0 Received: by 10.182.192.69 with SMTP id he5mr257148obc.84.1345704042219; Wed, 22 Aug 2012 23:40:42 -0700 (PDT) Received: by 10.76.135.34 with HTTP; Wed, 22 Aug 2012 23:40:42 -0700 (PDT) Date: Wed, 22 Aug 2012 23:40:42 -0700 Message-ID: Subject: Thoughts on inheritance docs From: Chris Travers To: Postgres Documentation Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201208/39 X-Sequence-Number: 7432 A few observations here. Want to get feedback before considering proposing a documentation update here. The first is that the only example given for table inheritance is a set/subset model, and the example is problematic for the reason that the caveats section discusses. Consequently it isn't immediately apparent how table inheritance (and in particular multiple inheritance which, unless I have missed something, seems to be unique to PostgreSQL). In general, I see table inheritance as useful for a large number of tasks including: * Set/subset modelling (here borrowing techniques from table partitioning is necessary-- the full set is partitioned according to interesting subsets, but each subset may extend associated info) * Enforcement of consistent semantics of join syntax, including functions that would allow you to automatically traverse joins. Consider: SELECT (bc.inventory_item).sku from barcodes bc where the inventory_item method is inherited from inventory_item_ref. Since inventory_item_ref would add a column called inventory_item_id to the table, we'd also know join syntax would generally be consistent. * Derivative information modelling of sets of columns which are insufficient for relational modelling by themselves (perhaps because they lack necessary join conditions) To my knowledge, the latter two are PostgreSQL-specific. They make very little sense unless multiple inheritance is permitted, and every other ORDBMS I have looked at (including Informix, DB2, and Oracle) has only supported single inheritance. Restricting to single inheritance makes sense if you are specializing on set/subset modelling but multiple inheritance is a tremendously useful tool that may be well beyond cutting edge. it might be worth showing this off in the documentation with real, working examples. So my questions: 1) Would it be worth coming up with more useful examples for table inheritance? 2) Would it be worth adding mention of uses of multiple table inheritance? 3) Would it be worth discussing how to position the limitations of table inheritance? I personally recognize the difficulties in documenting these but I can't help thinking that a simple chart of "this is/is not inherited" would be very useful as well. What do people think? Best Wishes, Chris Travers