Search Postgresql Archives

Re: INSERT before UPDATE?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



am  Thu, dem 16.08.2007, um 14:11:07 +0200 mailte Ji??í N??mec folgendes:
> > see
> > http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE
> 
> Yes I see, but I'll try to describe it in more detail:
> 
> I could write plpgsql trigger function which will UPDATE a record (or
> INSERT new record) when the record is not found. But as far as I know
> a trigger is not executed when a updated record is not found, so this
> solution doesn't work for me. I don't want to change my application -
> I would like to set this behaviour directly in PostgreSQL database so
> I couldn't use a method from your example (...which requires that all
> SQL UPDATE statements need to be modified).

Maybe you can achieve this with a RULE.
I'm not sure, but i would try ist.


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux