public inbox for [email protected]
help / color / mirror / Atom feedFrom: celati Laurent <[email protected]>
To: [email protected]
Subject: How to do an update with XML column ?
Date: Mon, 16 Dec 2024 17:07:05 +0100
Message-ID: <CAHByMH0taZ_gnh4kYYkPiOV-ZSRK-MjY=3ViMHzs4T8ddVH1MA@mail.gmail.com> (raw)
Dear all,
I'm taking the liberty to ask an question. Do you know if there are some
ways in order to update and/or do group by with an XML column ?
For instance,
select id, unnest(xpath(
'//cit:CI_Organisation/cit:name/gco:CharacterString/text()',
CAST(data AS XML),
ARRAY[
ARRAY['cit', 'http://standards.iso.org/iso/19115/-3/cit/2.0';],
ARRAY['gco', 'http://standards.iso.org/iso/19115/-3/gco/1.0';],
ARRAY['mdb','http://standards.iso.org/iso/19115/-3/mdb/2.0';],
ARRAY['cat','http://standards.iso.org/iso/19115/-3/cat/1.0';],
])) as orga_name, changedate, createdate, displayorder,
doctype, extra, popularity, rating, root, schemaid, title, istemplate,
isharvested, harvesturi,
harvestuuid, groupowner, metadata.owner, metadata.source, uuid
from public.metadata
group by orga_name
I obtained :
ERROR: could not identify an equality operator for type xml
LINE 39: group by orga_name
^
SQL state: 42883
Character: 2556
Thanks so much
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: How to do an update with XML column ?
In-Reply-To: <CAHByMH0taZ_gnh4kYYkPiOV-ZSRK-MjY=3ViMHzs4T8ddVH1MA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox