| 417 | |
| 418 | |
| 419 | Datum |
| 420 | xml_send(PG_FUNCTION_ARGS) |
| 421 | { |
| 422 | xmltype *x = PG_GETARG_XML_P(0); |
| 423 | char *outval; |
| 424 | StringInfoData buf; |
| 425 | |
| 426 | /* |
| 427 | * xml_out_internal doesn't convert the encoding, it just prints the right |
| 428 | * declaration. pq_sendtext will do the conversion. |
| 429 | */ |
| 430 | outval = xml_out_internal(x, pg_get_client_encoding()); |
| 431 | |
| 432 | pq_begintypsend(&buf); |
| 433 | pq_sendtext(&buf, outval, strlen(outval)); |
| 434 | pfree(outval); |
| 435 | PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); |
| 436 | } |
| 437 | |
| 438 | |
| 439 | #ifdef USE_LIBXML |
nothing calls this directly
no test coverage detected