INSERT/UPDATE .. RETURNING - Mailing list pgsql-sql

From Protasov Vladimir
Subject INSERT/UPDATE .. RETURNING
Date
Msg-id 606041294836076@web120.yandex.ru
Whole thread Raw
List pgsql-sql
Hello everybody, 
I have the table (named for example "mytable") and trigger on insert. The trigger do the following (in real trigger the
logicis more complicated, but there is no difference for this question):
 
INSERT INTO another_table VALUES (NEW.*);
RETURN NULL;

And i want to do the following:
INSERT INTO "mytable" VALUES ('blah', 'blah', 'blah') RETURNING *;

But result is empty. I've tried to add rule on insert into "mytable" with returning clause, but there is the problem
withone: returning clause will not be invoked if insert returns nothing. But i really need return value for the
insert.
Any ideas?

-- 
Regards,
Vladimir Protasov.


pgsql-sql by date:

Previous
From: -
Date:
Subject: Implement PostgreSQL full text search
Next
From: George Francis
Date:
Subject: joining one record according to max value