trigger on view returning created serial

From: Philipp Kraus <philipp(dot)kraus(at)flashpixx(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: trigger on view returning created serial
Date: 2012-06-12 20:35:49
Message-ID: 72314DCC-BFA1-4ABC-AA5F-E2DD35268164@flashpixx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have created a view and on this view a trigger, which is called on an insert command on the view.
Within the trigger I run an insert on a table and one of the table fields uses a serial sequence, that
creates values. If I run in the trigger after the insert a "return NEW", the field (id) which should
be set by the serial on the table is 0, so how can I get the new created serial on the insert command
within the trigger function?

Thanks

Phil

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yuriy Rusinov 2012-06-12 20:38:02 Reference with inheritance propagate data
Previous Message leaf_yxj 2012-06-12 19:35:20 Re: How to create c language in postgresql database. Thanks.