Skip site navigation (1) Skip section navigation (2)

Re: Pretty printed trigger in psql

From: "Brad T(dot) Sliger" <brad(at)sliger(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Pretty printed trigger in psql
Date: 2010-01-18 19:29:48
Message-ID: 201001181129.49439.brad@sliger.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tuesday 12 January 2010 01:06:22 Takahiro Itagaki wrote:
> 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()
>
> <snip>

	Greetings,

	I tried to apply this patch to the latest version of PostgreSQL in git (bbfc96e).  Some of the patch did not apply.  Please 
find attached the output from patch.  The full path of the ruleutils.c.rej is src/backend/utils/adt/ruleutils.c.rej

	Thanks,

	--bts

Attachment: ruleutils.c.rej
Description: text/x-diff (2.6 KB)
Attachment: patch.output
Description: text/plain (2.1 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-01-18 19:32:20
Subject: Re: review: More frame options in window functions
Previous:From: Pavel StehuleDate: 2010-01-18 19:20:58
Subject: Re: quoting psql varible as identifier

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group