suso escribió:

> CREATE OR REPLACE FUNCTION cambiar(clave character varying)
>   RETURNS boolean AS
> $BODY$
> BEGIN
>          execute 'ALTER ROLE '||current_user||' WITH PASSWORD 
> '''||clave||'''';
>         RETURN true;
> END;
> $BODY$
>   LANGUAGE 'plpgsql' VOLATILE

Te falta un quote_identifier() en el nombre, puesto que según tu ejemplo
el nombre es con una mayúsucla (Antonio en vez de antonio).

¿Para qué quieres una función para cambiar la clave?  ¿Por qué no usar
directamente ALTER ROLE?  No le veo la utilidad a tu función.

-- 
Alvaro Herrera                               http://planet.postgresql.org/
"Digital and video cameras have this adjustment and film cameras don't for the
same reason dogs and cats lick themselves: because they can."   (Ken Rockwell)
--
TIP 3: Si encontraste la respuesta a tu problema, publícala, otros te lo 
agradecerán

Responder a