Created
May 13, 2014 00:23
-
-
Save fgaray/714488e993d4a7c7cede to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION sp_crear_participante(nombre TEXT, clave TEXT) | |
RETURNS TEXT | |
AS | |
$$ | |
import json | |
from hashlib import md5 | |
m = md5() | |
m.update(clave) | |
claveEncriptada = m.hexdigest() | |
plan = plpy.prepare("INSERT INTO participante (nombre, clave) VALUES ($1, $2)", ["text", "text"]) | |
plpy.execute(plan, [nombre, claveEncriptada]) | |
return json.dumps(True) | |
$$ | |
LANGUAGE 'plpython2u'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment