From: Tom Lane on
Takahiro Itagaki <itagaki.takahiro(a)oss.ntt.co.jp> writes:
> The attached patch eliminates unneeded parentheses by using
> pg_get_triggerdef(pretty = true) in psql.

Is this patch reversed? It seems so but the listed file timestamps
don't match that idea ...

regards, tom lane

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

From: Takahiro Itagaki on

Tom Lane <tgl(a)sss.pgh.pa.us> wrote:

> Takahiro Itagaki <itagaki.takahiro(a)oss.ntt.co.jp> writes:
> > The attached patch eliminates unneeded parentheses by using
> > pg_get_triggerdef(pretty = true) in psql.
>
> Is this patch reversed? It seems so but the listed file timestamps
> don't match that idea ...

Sorry, I cannot understand what you mean...

My English might be broken. May I explain what I did again?

1. psql has been used pg_get_triggerdef(oid).

2. I added pg_get_triggerdef(oid, pretty = false) at the last commit fest
for pg_dump to support dumping triggeres with WHEN cluase. In that time,
PRETTYFLAG_PAREN and PRETTYFLAG_INDENT are used when pretty = true.

3 psql still uses pg_get_triggerdef(oid [, pretty=false] ).
Also, pg_dump should use (pretty=false) for safer migration.
No programs use pg_get_triggerdef(pretty=true) is for now.

4. psql will be better to use pg_get_triggerdef(oid, true) to display
trigger definitions cleanly, but it also should print them in one line.
For the purpose, the patch changes two things:
- Modify psql to use pg_get_triggerdef(oid, true) when server version >= 8.5.
- Remove PRETTYFLAG_INDENT from pg_get_triggerdef(). It will partially
revert the changes in 2.

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



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

From: Tom Lane on
Takahiro Itagaki <itagaki.takahiro(a)oss.ntt.co.jp> writes:
> Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
>> Is this patch reversed? It seems so but the listed file timestamps
>> don't match that idea ...

> Sorry, I cannot understand what you mean...

The patch looks like it removes, rather than adds, your intended
changes.

regards, tom lane

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

From: "Brad T. Sliger" on
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
From: Takahiro Itagaki on

"Brad T. Sliger" <brad(a)sliger.org> wrote:

> 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

The attached patch is rebased to current CVS.

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