[GENERAL] using hstore to store documents - Mailing list pgsql-general

From David G. Johnston
Subject [GENERAL] using hstore to store documents
Date
Msg-id CAKFQuwZpdHTDtkhC7ru7aU4U5NVLP6s_R-QZN_fZStKjjROukQ@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] using hstore to store documents  (Rita <rmorgan466@gmail.com>)
Responses Re: [GENERAL] using hstore to store documents
List pgsql-general
On Saturday, January 28, 2017, Rita <rmorgan466@gmail.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.

pgsql-general by date:

Previous
From: Rita
Date:
Subject: Re: [GENERAL] using hstore to store documents
Next
From: Nikolai Zhubr
Date:
Subject: [GENERAL] Causeless CPU load waves in backend, on windows, 9.5.5 (EDB binary).