Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

351
Vistas
how to convert base64 string to bytea in postgresql8.2

I need to convert base64 string to bytea type. But when I Executed SQL statements by the pgAdminIII:

select decode("ygAAA", 'base64');

I got the following error message:

ERROR:  syntax error at or near ")"
LINE 1: select decode('ygAAA', 'base64');
                                                              ^
********** 错误 **********

ERROR: syntax error at or near ")"
SQL 状态: 42601
字符:59

My postgresql's version is 8.2.15. And I could use encode function. I googled it, but didn't find the solution. Can somebody help me? TKS!

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Try it with single quotes instead of double quotes. Also base 64 strings turn groups of 4 characters into 3 bytes (24 bits in 3 bytes are spread across the lower 6 bits of 4 characters.) So your base64 string is invalid.

This works:

select decode('ygAA', 'base64');

Hope this helps,

Adam.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda