Re: UPDATE keyword

From: "Ian Harding" <ianh(at)co(dot)pierce(dot)wa(dot)us>
To: <pgsql-general(at)postgresql(dot)org>, <rpijlman(at)spamcop(dot)net>
Subject: Re: UPDATE keyword
Date: 2001-05-29 14:03:36
Message-ID: sb134a4c.097@emgateways.co.pierce.wa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

True, true... but the next time I need the code to fire I would need ot remember that I had set it to 1 and set it to something else...

Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: ianh(at)tpchd(dot)org

>>> Rene Pijlman <rpijlman(at)spamcop(dot)net> 05/26/01 01:56AM >>>
ianh(at)healthdept(dot)co(dot)pierce(dot)wa(dot)us ("Ian Harding") schreef:
>UPDATE mytable SET myfield = myfield WHERE...
>to fire an update trigger, and executing only the code in that
>trigger surrounded by UPDATE(myfield).

So you update a field by not changing its value, to execute a piece of
code that has nothing to do with the field and the value :-)

>Is there an easy way to duplicate this, or should I work around it?

Isn't it easier (and more poratble) to add a dummy field to the table?
Then you can do:

UPDATE mytable
SET dummy = 1 - dummy
WHERE ...

to execute the piece of code that responds to an update of 'dummy'.

Regards,
René Pijlman

http://www.applinet.nl

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-05-29 14:08:21 Re: Problems with new data location
Previous Message Dave Robinson 2001-05-29 13:55:19 Re: transactions on Postgresql