From: | Shawn Harrison <harrison(at)tbc(dot)net> |
---|---|
To: | PgSQL General List <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Allowing update of column only from trigger |
Date: | 2005-01-31 18:33:50 |
Message-ID: | 41FE7A0E.8070900@tbc.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
PFC wrote [01/28/05 7:08 PM]:
>
> First you should use a ltree type for the uri field :
Yes, it would be very good if I could use ltree rather than rolling my
own, but ltree doesn't meet my use requirements.
> - you write it foo.bar instead of /foo/bar
That is the problem: The point is to make look-up based on uri or
filesystem path very efficient.
> - there are operators on ltree types to express "is parent of", "is
> children of"
> - these operators are indexed
I have written similar pure-SQL functions for my parent/uri system,
though without the syntax shortcuts of the ltree operators.
> [...]
> Now about your update problem, when you rename foo.bar into
> foo.crum.bar you could, in a single update, replace all foo.bar by
> foo.crum.bar in all your table with the ltree operators and special
> functions.
That's an approach I hadn't considered. Hmmm, I'd have to read the ltree
C sources to see how it does this....
> And for your checks, you can add a CHECK on the url field to be sure
> it's equal to the url of the parent + the name of the current row.
> It'll make one more SELECT request, though.
Yes, I'd like to avoid extra selects as much as possible.
Thank you very much for your interaction -- very helpful.
--
________________
harrison(at)tbc(dot)net
From | Date | Subject | |
---|---|---|---|
Next Message | Shawn Harrison | 2005-01-31 18:35:35 | Re: Allowing update of column only from trigger |
Previous Message | Tom Lane | 2005-01-31 18:16:49 | Re: "Invalid multibyte character for locale" still there |