Message posté par : image95
----------------------------------------
Bonjour,
Je me permets une petite question additionnelle. Sauriez vous si il est possible de faire
un update sur un champ XML ? Dans notre exemple le fameux champ 'data' ? Je ne
sais pas quelles pistes permettraient de faire des update en XML avec postgresql ? Sinon,
concernant le dernier message et un test de order by ou de group by, j'ai un message
d'erreur :
-----------------
Code :
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']-3/mdb/2.0'],
ARRAY['cat','http://standards.iso.org/iso/19115/-3/cat/1.0']-3/cat/1.0'],
ARRAY['gfc','http://standards.iso.org/iso/19110/gfc/1.1']10/gfc/1.1'],
ARRAY['cit','http://standards.iso.org/iso/19115/-3/cit/2.0']-3/cit/2.0'],
ARRAY['gcx','http://standards.iso.org/iso/19115/-3/gcx/1.0']-3/gcx/1.0'],
ARRAY['gex','http://standards.iso.org/iso/19115/-3/gex/1.0']-3/gex/1.0'],
ARRAY['lan','http://standards.iso.org/iso/19115/-3/lan/1.0']-3/lan/1.0'],
ARRAY['srv','http://standards.iso.org/iso/19115/-3/srv/2.1']-3/srv/2.1'],
ARRAY['mas','http://standards.iso.org/iso/19115/-3/mas/1.0']-3/mas/1.0'],
ARRAY['mcc','http://standards.iso.org/iso/19115/-3/mcc/1.0']-3/mcc/1.0'],
ARRAY['mco','http://standards.iso.org/iso/19115/-3/mco/1.0']-3/mco/1.0'],
ARRAY['mda','http://standards.iso.org/iso/19115/-3/mda/1.0']-3/mda/1.0'],
ARRAY['mds','http://standards.iso.org/iso/19115/-3/mds/2.0']-3/mds/2.0'],
ARRAY['mdt','http://standards.iso.org/iso/19115/-3/mdt/2.0']-3/mdt/2.0'],
ARRAY['mex','http://standards.iso.org/iso/19115/-3/mex/1.0']-3/mex/1.0'],
ARRAY['mmi','http://standards.iso.org/iso/19115/-3/mmi/1.0']-3/mmi/1.0'],
ARRAY['mpc','http://standards.iso.org/iso/19115/-3/mpc/1.0']-3/mpc/1.0'],
ARRAY['mrc','http://standards.iso.org/iso/19115/-3/mrc/2.0']-3/mrc/2.0'],
ARRAY['mrd','http://standards.iso.org/iso/19115/-3/mrd/1.0']-3/mrd/1.0'],
ARRAY['mri','http://standards.iso.org/iso/19115/-3/mri/1.0']-3/mri/1.0'],
ARRAY['mrl','http://standards.iso.org/iso/19115/-3/mrl/2.0']-3/mrl/2.0'],
ARRAY['mrs','http://standards.iso.org/iso/19115/-3/mrs/1.0']-3/mrs/1.0'],
ARRAY['msr','http://standards.iso.org/iso/19115/-3/msr/2.0']-3/msr/2.0'],
ARRAY['mdq','http://standards.iso.org/iso/19157/-2/mdq/1.0']-2/mdq/1.0'],
ARRAY['mac','http://standards.iso.org/iso/19115/-3/mac/2.0']-3/mac/2.0'],
ARRAY['gco','http://standards.iso.org/iso/19115/-3/gco/1.0']-3/gco/1.0'],
ARRAY['gml','http://www.opengis.net/gml/3.2']et/gml/3.2'],
ARRAY['xlink','http://www.w3.org/1999/xlink']1999/xlink'],
ARRAY['xsi','http://www.w3.org/2001/XMLSchema-instance']
])) 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
-----------------
J'obtiens
-----------------
Code :
ERROR: could not identify an equality operator for type xml
LINE 39: group by orga_name
^
SQL state: 42883
Character: 2556
-----------------
----------------------------------------
Le message est situé
https://georezo.net/forum/viewtopic.php?pid=370805#p370805
Pour y répondre : geobd(a)ml.georezo.net ou reply de votre messagerie
Pour vous désabonner connectez-vous sur le forum puis Profil / Abonnement
--
Association GeoRezo - le portail géomatique
https://georezo.net