Pretty printed trigger in psql
Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
From: Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
To: pgsql-hackers@postgresql.org
Date: 2010-01-12T09:06:22Z
Lists: pgsql-hackers
Attachments
- pretty-printed-trigger_20100112.patch (application/octet-stream) patch
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