devanshu0987 commented on issue #12709:
URL: https://github.com/apache/datafusion/issues/12709#issuecomment-3834607055

   > it seems postgres will convert it to the hex representation
   
   Yes. I used Cursor to find the implementation. Seems it does a hex_encode.
   `src/backend/utils/adt/bytea.c`
   
   ```
   Datum
   byteaout(PG_FUNCTION_ARGS)
   {
        bytea      *vlena = PG_GETARG_BYTEA_PP(0);
        char       *result;
        char       *rp;
   
        if (bytea_output == BYTEA_OUTPUT_HEX)
        {
                /* Print hex format */
                rp = result = palloc(VARSIZE_ANY_EXHDR(vlena) * 2 + 2 + 1);
                *rp++ = '\\';
                *rp++ = 'x';
                rp += hex_encode(VARDATA_ANY(vlena), VARSIZE_ANY_EXHDR(vlena), 
rp);
        }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to