0

I have a PostgreSQL bytea field. Using this query in pgAdmin, i get this result:

Query:

SELECT bytea_column::text FROM users where email = 'xxxx@gmail.com';

Result (text):

\014\321\031\353\354\005\263\....

If I try to get the value using this Laravel (or direct query from PHP) I get a different result:

$result = DB::table('users')
->select(DB::raw('bytea_column::text as result'))
->where('email', '=', 'xxxx@gmail.com')
->value('result');

Result:

\x01ea86c105cd00eab4606c...

Any ideas on how to get the text value that I get with the query on pgAdmin?

Thanks!

Alex
  • 16,739
  • 1
  • 28
  • 51
Hector
  • 139
  • 3

0 Answers0