Created
May 20, 2020 11:36
-
-
Save 62mkv/e2e91e878b139fc4e80003b6c1dabf4e to your computer and use it in GitHub Desktop.
How to use XPath against XML text fields with PostgreSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* real-world example */ | |
select xpath('/ns2:PrintData/Meta/Document/@id', xmlparse (document payload), | |
ARRAY[ARRAY['ns2', 'http://iopm.int.kn/iopm4xml/meta/v1.4']]) from request_history_step_payload rhsp | |
join request_history_step rhs on rhs.step_uuid = rhsp.step_uuid | |
where rhs.step_type = 'PRINTER_REQUEST' and rhs.started_at between '2020-05-19' and now() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment