using hstore to store documents

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Rita <rmorgan466(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: using hstore to store documents
Date: 2017-01-30 02:45:55
Message-ID: CAKFQuwZpdHTDtkhC7ru7aU4U5NVLP6s_R-QZN_fZStKjjROukQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Saturday, January 28, 2017, Rita <rmorgan466(at)gmail(dot)com> wrote:

> After xmltest has been populated, I can run xpath and unest to get my data
> into a row but I would like to store that result in another table, I am
> guessing I should look into triggers for something like that?
>

I suspect that using xpath in the database is not the right tool for doing
what you describe. Whatever middleware layer receives the XML should be
considered for the logic of deserialization and storage to the database in
normalized form. If you do want something like that in the database I'd
probably write a volatile function the receives xml and does whatever it
needs to do. I cannot imagine the indirection of a trigger would be
gainful here.

In particular, at scale you'd probably be better off with using a streaming
parser instead of a DOM one.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nikolai Zhubr 2017-01-30 09:16:25 Causeless CPU load waves in backend, on windows, 9.5.5 (EDB binary).
Previous Message Rita 2017-01-30 01:02:21 Re: using hstore to store documents