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
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
alling triggering function
> To: "Tom Lane"
> Cc: pgsql-general@postgresql.org
> Date: Thursday, January 28, 2010, 8:53 AM
>
> Thanks and Regards
> Yan Cheng CHEOK
>
>
> --- On Thu, 1/28/10, Tom Lane
> wrote:
>
> > From: Tom Lane
> > Subject:
Thanks and Regards
Yan Cheng CHEOK
--- On Thu, 1/28/10, Tom Lane wrote:
> From: Tom Lane
> Subject: Re: [GENERAL] Problem after installing triggering function
> To: "Yan Cheng Cheok"
> Cc: pgsql-general@postgresql.org
> Date: Thursday, January 28, 2010, 12:34 AM
&g
Yan Cheng Cheok 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 auto generated p
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 no