Re: [HACKERS] Indicate disabled triggers in \d

Поиск
Список
Период
Сортировка
Искать

Re: [HACKERS] Indicate disabled triggers in \d

От:
"Brendan Jurd" <direvus@gmail.com>
Дата:
Вложения:
As discussed briefly on pgsql-hackers, the current psql \d command
does not make any distinction between enabled and disabled triggers.

The attached patch modifies psql's describeOneTableDetails() such that
triggers and disabled triggers are displayed as two separate footer
lists, for example:

Triggers:
   y AFTER DELETE ON x FOR EACH ROW EXECUTE PROCEDURE do_something()
Disabled triggers:
   z BEFORE INSERT ON x FOR EACH ROW EXECUTE PROCEDURE input_stuff()

The patch compiled and tested cleanly on my machine, and passed all
regression tests.

I didn't find any relevant documentation that needed patching, so this
feature add should work fine as a standalone patch.

Regards,
BJ

Re: [HACKERS] Indicate disabled triggers in \d

От:
"Brendan Jurd" <direvus@gmail.com>
Дата:
Вложения:
On 11/7/06, Brendan Jurd  wrote:
> As discussed briefly on pgsql-hackers, the current psql \d command
> does not make any distinction between enabled and disabled triggers.
>
> The attached patch modifies psql's describeOneTableDetails() such that
> triggers and disabled triggers are displayed as two separate footer
> lists, for example:
>

Minor fix to the previous patch; result7 was not being cleared at the
end of the block.

Re: [HACKERS] Indicate disabled triggers in \d

От:
Neil Conway <neilc@samurai.com>
Дата:
On Tue, 2006-11-07 at 16:21 +1100, Brendan Jurd wrote:
> Minor fix to the previous patch; result7 was not being cleared at the
> end of the block.

The patch still leaks result7 circa line 1400 (CVS HEAD). I didn't look
closely, but you probably also leak result7 circa line 1209, if result6
is NULL.

(Yeah, we definitely need to refactor describeOneTableDetails().)

-Neil


Re: [HACKERS] Indicate disabled triggers in \d

От:
"Brendan Jurd" <direvus@gmail.com>
Дата:
Вложения:
On 11/11/06, Neil Conway  wrote:
>
> The patch still leaks result7 circa line 1400 (CVS HEAD). I didn't look
> closely, but you probably also leak result7 circa line 1209, if result6
> is NULL.

New version of the patch attached (against CVS HEAD) that fixes these
two issues.

> (Yeah, we definitely need to refactor describeOneTableDetails().)

I'd be interested in doing some work on this.  What did you have in mind?

BJ

Re: [HACKERS] Indicate disabled triggers in \d

От:
Bruce Momjian <bruce@momjian.us>
Дата:

This has been saved for the 8.3 release:

	http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Brendan Jurd wrote:
> On 11/7/06, Brendan Jurd  wrote:
> > As discussed briefly on pgsql-hackers, the current psql \d command
> > does not make any distinction between enabled and disabled triggers.
> >
> > The attached patch modifies psql's describeOneTableDetails() such that
> > triggers and disabled triggers are displayed as two separate footer
> > lists, for example:
> >
> 
> Minor fix to the previous patch; result7 was not being cleared at the
> end of the block.

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

-- 
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Re: [HACKERS] Indicate disabled triggers in \d

От:
Bruce Momjian <bruce@momjian.us>
Дата:

Patch applied by Neil.  Thanks.

---------------------------------------------------------------------------


Brendan Jurd wrote:
> On 11/7/06, Brendan Jurd  wrote:
> > As discussed briefly on pgsql-hackers, the current psql \d command
> > does not make any distinction between enabled and disabled triggers.
> >
> > The attached patch modifies psql's describeOneTableDetails() such that
> > triggers and disabled triggers are displayed as two separate footer
> > lists, for example:
> >
> 
> Minor fix to the previous patch; result7 was not being cleared at the
> end of the block.

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

-- 
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
FAQ