The key question

Stored content alone does not determine the migration. Some applications persist a document and return it unchanged; others query or transform XML inside SQL. Those cases need different target designs and tests.

What to inventory

  • List XMLTYPE columns, indexes and dependent functions.
  • Collect document sizes, namespaces, encodings and NULL cases.
  • Identify XPath/XQuery usage and XML generation in application code.

Design the target deliberately

PostgreSQL provides an xml data type, but that does not imply feature-for-feature equivalence with Oracle XML functions. Test representative documents with the actual queries. Moving to JSON only makes sense if the business format may change; it is not a lossless default conversion.

A concrete validation step

Choose three real document classes: a small normal case, a large production case and a document with unusual namespaces. Define the expected query results before building the target implementation.

Evidence required before sign-off

  • Process documents with and without namespaces.
  • Test empty documents, special characters and large payloads.
  • Compare query results and serialization at business level.
  • Measure the common XML queries on realistic target data.

Primary sources & further reading

These recommendations are engineering guidance. Specific options depend on source and target versions, privileges and operating model.