On Tue, Dec 15, 2009 at 1:23 AM, Pavel Stehule wrote:
> Hello
>
> NEW and OLD is comparable in 8.4. In 8.3 and older you have to use
> little bit different syntax
>
> http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Fast_compare_variables_NEW_and_OLD_in_trigger.27s_body
>
Thanks, Pavel! Thi
Hello.
It seems that this works (I made tests on permanent table, postgresql
8.4.0):
CREATE OR REPLACE FUNCTION track_updates()
RETURNS TRIGGER AS $$
DECLARE
BEGIN
IF TG_OP = 'UPDATE' THEN
IF NEW IS NOT DISTINCT FROM OLD THEN
RAISE NOTICE 'OLD and NEW are the same!';
Hello
NEW and OLD is comparable in 8.4. In 8.3 and older you have to use
little bit different syntax
http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Fast_compare_variables_NEW_and_OLD_in_trigger.27s_body
Regards
Pavel Stehule
2009/12/15 Josh Kupershmidt :
> Hi all,
>
> Short version of m
Hi all,
Short version of my question:
What's the best way to compare arbitrary records (OLD and NEW, in my
case) using PL/pgSQL in Postgres 8.3, without knowing anything about
the structure of the records? If the answer is to cast OLD and NEW to
text, and then compare, as suggested in [1], what fa