• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

babelfish-for-postgresql / babelfish_extensions / 26873033882

03 Jun 2026 08:28AM UTC coverage: 77.184% (+0.02%) from 77.167%
26873033882

push

github

web-flow
Add support for the method .query() for XML data type (#4845)

Currently, Babelfish supports .exist() and .value() XML methods but .query() was unsupported and threw an error.
With this change, .query(xpath) is now supported and returns XML results (for XPath 1.0 compatible queries).

The implementation follows the same 3-stage architecture like .exist() and .value():

ANTLR rewriting: @x.query('/path') is rewritten to sys.bbf_xmlquery('/path', @x)
Grammar: BBF_XMLQUERY is mapped in gram-tsql-rule.y
PL/pgSQL function sys.bbf_xmlquery(): validates the input type, checks QUOTED_IDENTIFIER, calls PostgreSQL's
xpath(), and returns the result as XML

Task: BABEL-5224
Signed-off-by: Japleen Kaur <amjj@amazon.com>

36 of 38 new or added lines in 3 files covered. (94.74%)

54284 of 70331 relevant lines covered (77.18%)

396574.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.41
/contrib/babelfishpg_tsql/src/tsqlUnsupportedFeatureHandler.cpp


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc