Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql "invalid end sequence"

I've a function which adds users on my application. It does a few check, salts and hashes the password and then inserts the values. Now, when i run the function I get

ERROR: invalid end sequence

(to be honest, i get it in italian and had to do quite a job to find the corresponding english string). Now, the single parts work very well alone, but if I put everything together in a function I get the error so I'm pretty out of ideas. Any suggestion?

like image 404
frollo Avatar asked Sep 07 '25 01:09

frollo


1 Answers

This error happens when trying to decode incorrectly encoded base64 contents. Example:

=> select decode('aa', 'base64');

ERROR: invalid end sequence

as opposed to:

=> select decode('aa==', 'base64');
 decode 
--------
 \x69
(1 row)
like image 106
Daniel Vérité Avatar answered Sep 10 '25 01:09

Daniel Vérité