Re: Postgres 9.6 - ltree extension - (re)build a tree on a table

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Luca <lordluke80(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Postgres 9.6 - ltree extension - (re)build a tree on a table
Date: 2018-04-18 00:30:14
Message-ID: CAKFQuwYggqUSW_yTui5U+1PzEK1+UA7zcj+4MepWV95tKD-NCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Apr 17, 2018 at 3:11 AM, Luca <lordluke80(at)gmail(dot)com> wrote:

> Since this table should be updated after a data import, so after a massive
> upsert, ideally I would i'd like to have a function
> called after that is completed, in order to (re)build the 'path' column
> for each record, which means rebuild the tree.
>

​Have you considered/tried an "FOR EACH STATEMENT" trigger instead of "FOR
EACH ROW"​?

The transition tables feature introduced in v10 probably will be of
significant help here as well - though I haven't any practical experience
with it personally.

https://www.postgresql.org/docs/current/static/sql-createtrigger.html

David J.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Stainburn 2018-04-18 09:20:39 summary view design / performance
Previous Message Steve Midgley 2018-04-18 00:19:44 Re: Postgres 9.6 - ltree extension - (re)build a tree on a table