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

Re: Pretty printed trigger in psql

From: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Pretty printed trigger in psql
Date: 2010-01-14 05:30:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)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.

Takahiro Itagaki
NTT Open Source Software Center

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2010-01-14 05:52:10
Subject: Re: Pretty printed trigger in psql
Previous:From: James William PyeDate: 2010-01-14 04:39:05
Subject: Re: plpython3

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