Re: [GENERAL] Problem after installing triggering function

2010-01-29 Thread Alban Hertroys
On 29 Jan 2010, at 2:06, Yan Cheng Cheok wrote: CREATE OR REPLACE FUNCTION insert_table() RETURNS void AS $BODY$DECLARE _impressions_by_day impressions_by_day; BEGIN INSERT INTO impressions_by_day(impressions ) VALUES(888) RETURNING * INTO _impressions_by_day; RAISE NOTICE

Re: [GENERAL] Problem after installing triggering function

2010-01-28 Thread Yan Cheng Cheok
To reproduce the problem, here is some simple steps to follow : (1) create database named tutorial (2) perform the following SQL query : CREATE TABLE impressions_by_day ( advertiser_id SERIAL NOT NULL, day DATE NOT NULL DEFAULT CURRENT_DATE, impressions INTEGER NOT NULL,

[GENERAL] Problem after installing triggering function

2010-01-27 Thread Yan Cheng Cheok
I have a stored procedure execute the following code : INSERT INTO unit(fk_lot_id, cycle) VALUES(_lotID, _cycle) RETURNING * INTO _unit; raise notice 'AFTER INSERT INTO UNIT, _unit.unit_id = %', _unit.unit_id ; unit_id column, is an auto generated primary key. I will always get a

Re: [GENERAL] Problem after installing triggering function

2010-01-27 Thread Tom Lane
Yan Cheng Cheok ycch...@yahoo.com writes: I have a stored procedure execute the following code : INSERT INTO unit(fk_lot_id, cycle) VALUES(_lotID, _cycle) RETURNING * INTO _unit; raise notice 'AFTER INSERT INTO UNIT, _unit.unit_id = %', _unit.unit_id ; unit_id column, is an

Re: [GENERAL] Problem after installing triggering function

2010-01-27 Thread Yan Cheng Cheok
Thanks and Regards Yan Cheng CHEOK --- On Thu, 1/28/10, Tom Lane t...@sss.pgh.pa.us wrote: From: Tom Lane t...@sss.pgh.pa.us Subject: Re: [GENERAL] Problem after installing triggering function To: Yan Cheng Cheok ycch...@yahoo.com Cc: pgsql-general@postgresql.org Date: Thursday, January

Re: [GENERAL] Problem after installing triggering function

2010-01-27 Thread Yan Cheng Cheok
Subject: Re: [GENERAL] Problem after installing triggering function To: Yan Cheng Cheok ycch...@yahoo.com Cc: pgsql-general@postgresql.org Date: Thursday, January 28, 2010, 12:34 AM Yan Cheng Cheok ycch...@yahoo.com writes: I have a stored procedure execute the following code