Psql shows too many parentheses when it prints triggers with WHEN clause.

postgres=# \d t1
      Table "public.t1"
 Column |  Type   | Modifiers
--------+---------+-----------
 c1     | integer |
Triggers:
    mytrig AFTER UPDATE ON t1 FOR EACH ROW
    WHEN ((old.c1 <> new.c1)) EXECUTE PROCEDURE myfunc()
          ^                ^

The attached patch eliminates unneeded parentheses by using
pg_get_triggerdef(pretty = true) in psql.

Triggers:
    mytrig AFTER UPDATE ON t1 FOR EACH ROW
    WHEN (old.c1 <> new.c1) EXECUTE PROCEDURE myfunc()

I think this change is harmless because we don't use
pg_get_triggerdef(pretty = true) in any programs, including pg_dump.

Is this change ok?

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center

Attachment: pretty-printed-trigger_20100112.patch
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to