Re: [pgsql-es-ayuda] ayuda TRIGGER

2010-06-10 Por tema Guillermo Villanueva
no se mucho de plpgsql pero fijate que NEW.item_id != NEW.item_id nunca va a dar true Otra tema: en un trigger que no sea del tipo "instead of" no tenés que ejecutar la sentencia sobre la cual trabaja el trigger, ya que esta se ejecuta sola si es que no hay un rollback. Saludos ~~~ G

Re: [pgsql-es-ayuda] ayuda TRIGGER

2010-06-10 Por tema Guillermo Villanueva
Henry, no me quedó muy claro en que necesitás ayuda. De todas maneras, con respecto al diseño, no entiendo el sentido que tengas el campo stock en otra tabla. Si esa otra tabla tendría por ejemplo un campo adicional de fecha, y que ahí puedas tener un historial de stock, sería mas comprensible, per

Re: [pgsql-es-ayuda] ayuda TRIGGER

2010-06-09 Por tema Alvaro Herrera
Excerpts from Henrry Joshney Servitá Sánchez's message of mié jun 09 23:59:56 -0400 2010: > estoy creando un trigger que me controle al momento de insertar un nuevo > registro en la tabla item se inserte otro registro en la tabla stock con el > campo item_id de la tabla iten y el quantity con e

[pgsql-es-ayuda] ayuda TRIGGER

2010-06-09 Por tema Henrry Joshney Servitá Sánchez
buenas tengo las siguientes tablas. CREATE TABLE item ( item_id serial NOT NULL, description character varying(64) NOT NULL, cost_price numeric(7,2), sell_price numeric(7,2), CONSTRAINT item_pk PRIMARY KEY (item_id) ) WITH ( OIDS=FALSE ); CREATE TABLE stock ( item_id integer NOT NUL