Search Postgresql Archives

Re: "Reverse" inheritance?

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

 



I agree with the barking up the wrong tree, building a physical tree in tables doesn't sound right given that you will have to create a new branch in the tree when a new version/variation of ubuntu comes out.

Also think about how you are going to do basic queries like listing all known unix variants; if that is hidden in the table names then you'll have to issue DDL queries to do the work of SELECT queries, which just sounds wrong to me.

I'd go for a tree, possibly using recursive CTE's to dig it.

On 2017-04-04 05:19, Tim Uckun wrote:
I have thought of doing something like a single table inheritance and it
could be done but I thought this might be a little more elegant.

On Tue, Apr 4, 2017 at 2:15 PM, David G. Johnston <
david.g.johnston@xxxxxxxxx> wrote:

On Mon, Apr 3, 2017 at 7:07 PM, Tim Uckun <timuckun@xxxxxxxxx> wrote:

I am trying to make postgres tables work like an object hierarchy. As an
example I have done this.


​I suspect you are barking up the wrong tree ;)

You are probably better off incorporating something like the "ltree" type
to encode the taxonomy.

https://www.postgresql.org/docs/current/static/ltree.html

I haven't had a chance to leverage it myself but the concept it embodies
is solid.

David J.
​



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux