provavelmente é isso que precisas.
Mas essa não seria a melhor função para criptografia, dá uma senha muito fraca.
podes usar md5,
http://osdir.com/ml/db.postgresql.brasil/2003-03/msg00164.html
http://www.slideshare.net/telles/postgresql-o-elefante-encouraado-presentation

CREATE OR REPLACE FUNCTION encrypt(phrase text)
RETURNS text AS $$
  DECLARE
     phrase ALIAS FOR $1;
     ret text;
     i integer := 1;
     j integer := length(phrase);
  BEGIN
    ret := '';
     WHILE(i <= j) LOOP
        ret := ret || chr(ascii(substr(phrase, i, 1)) + i);
        i := i + 1;
     END LOOP;
     RETURN ret;
  END;
$$ LANGUAGE plpgsql;



-- 
-------------------------------------------------------------
Rudinei Dias
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a