FAQ
Hi

I am trying to create a TRIGGER function,that populates values to another
table upon inserting a value into a table. The issue is,if there is a
exception(in Table 2) everything gets rolled back including Table1.I dont
want this to happen.i want the value of table1 to stay.
I tried "try....except" and introduced SAVEPOINT.But resulted in runtime
error.

Can anyone please help me out

--
Deepak

Search Discussions

  • Joshua D. Drake at Jun 20, 2008 at 4:19 pm

    On Fri, 2008-06-20 at 13:10 +0530, Deepak wrote:


    Hi

    I am trying to create a TRIGGER function,that populates values to
    another table upon inserting a value into a table. The issue is,if
    there is a exception(in Table 2) everything gets rolled back including
    Table1.I dont want this to happen.i want the value of table1 to stay.
    I tried "try....except" and introduced SAVEPOINT.But resulted in
    runtime error.

    Can anyone please help me out
    The function executed by the trigger will be executed as a single
    transaction. If any part fails, they all fail.

    Joshua D. Drake
    --
    Deepak
  • Robert Treat at Jun 23, 2008 at 12:41 am

    On Friday 20 June 2008 12:19:03 Joshua D. Drake wrote:
    On Fri, 2008-06-20 at 13:10 +0530, Deepak wrote:
    Hi

    I am trying to create a TRIGGER function,that populates values to
    another table upon inserting a value into a table. The issue is,if
    there is a exception(in Table 2) everything gets rolled back including
    Table1.I dont want this to happen.i want the value of table1 to stay.
    I tried "try....except" and introduced SAVEPOINT.But resulted in
    runtime error.

    Can anyone please help me out
    The function executed by the trigger will be executed as a single
    transaction. If any part fails, they all fail.
    Well, wrapping the bits of table2 in a begin....exception block would allow
    him to do what he wants.

    --
    Robert Treat
    Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedJun 20, '08 at 7:40a
activeJun 23, '08 at 12:41a
posts3
users3
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase