is there a recommended way to update many postgres schemes I have a database in postgres which has 15 schemes, the schemes are identical with the same tables, views and functions.

the system uses one scheme at a time, as if they were separate databases. So when i install an update i need to update the 15 schemes in the database.

My problem comes when we update the database with changes in functions and triggers, because I need to modify in each function what scheme uses for each scheme; example:

CREATE OR REPLACE FUNCTION cliente11."restablecerComprobante"("numeroComprobante" text)
  RETURNS integer AS
$BODY$
DECLARE idComprobante INTEGER;
DECLARE tipoComprobante TEXT;
DECLARE idCliente INTEGER;
DECLARE fechaComprobante DATE;
DECLARE totalComprobante NUMERIC;
DECLARE estadoComprobante INTEGER;
DECLARE percepcionIIBB NUMERIC;
DECLARE percepcionIIBBxKg NUMERIC;
DECLARE percepcionIVA NUMERIC;
BEGIN

    -- cargo los datos del comprobante
    SELECT id, tipo, cli_id, fecha_comprobante, total_comprobante, percepcion_iibb, percepcion_iibb_kg, percepcion_iva INTO idComprobante, tipoComprobante, idCliente, fechaComprobante, totalComprobante, percepcionIIBB, percepcionIIBBxKg, percepcionIVA FROM cliente11.lista_comprobantes_a_liberar WHERE estado = 0 AND numero_comprobante ILIKE "numeroComprobante";

    -- otras consultas...

    -- genero las comisiones
    SELECT cliente11."generarComisionesVenta"(idComprobante, tipoComprobante) INTO estadoComprobante;

RETURN 1;
END;
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;


Is there a more practical way to update the 15 schemes without having to modify the script to run in each scheme?
Why don't you set the variable search_path to be each schema in turn?

See http://www.postgresql.org/docs/current/static/runtime-config-client.html