Re: Add more information_schema columns

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add more information_schema columns
Date: 2018-02-06 19:03:29
Message-ID: d94a3be5-8331-79bb-f634-ad4283f57575@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/6/18 02:15, Michael Paquier wrote:
>> - CAST(null AS cardinal_number) AS action_order,
>> -- XXX strange hacks follow
>> + CAST(rank() OVER (PARTITION BY n.oid, c.oid, em.num, (t.tgtype & 1 & 66) ORDER BY t.tgname) AS cardinal_number) AS action_order,
>
> Better to use parenthesis for (t.tgtype & 1 & 66) perhaps? You may want
> to comment that this is to filter per row-statement first, and then with
> after/before/instead of, which are what the 1 and the 66 are for.

Added more comments.

>> - CAST(null AS sql_identifier) AS action_reference_old_table,
>> - CAST(null AS sql_identifier) AS action_reference_new_table,
>> + CAST(tgoldtable AS sql_identifier) AS action_reference_old_table,
>> + CAST(tgnewtable AS sql_identifier) AS action_reference_new_table,
>
>> +SELECT trigger_name, event_manipulation, event_object_schema,
>> event_object_table, action_order, action_condition,
>> action_orientation, action_timing, action_reference_old_table,
>> action_reference_new_table FROM information_schema.triggers ORDER BY
>> 1, 2;
>
> Writing those SQL queries across multiple lines would make them easier
> to read...

done

How about the attached version?

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v2-0001-Add-more-information_schema-columns.patch text/plain 18.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-02-06 19:11:36 Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)
Previous Message Robert Haas 2018-02-06 18:50:28 Re: Query running for very long time (server hanged) with parallel append