Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3c505ef

Browse files
committed
Fill in information schema column for trigger WHEN condition
1 parente6df063 commit3c505ef

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

‎doc/src/sgml/information_schema.sgml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.42 2009/12/05 21:31:05 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.43 2009/12/30 22:48:10 petere Exp $ -->
22

33
<chapter id="information-schema">
44
<title>The Information Schema</title>
@@ -4875,7 +4875,11 @@ ORDER BY c.ordinal_position;
48754875
<row>
48764876
<entry><literal>action_condition</literal></entry>
48774877
<entry><type>character_data</type></entry>
4878-
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4878+
<entry>
4879+
<literal>WHEN</literal> condition of the trigger, null if none
4880+
(also null if the table is not owned by a currently enabled
4881+
role)
4882+
</entry>
48794883
</row>
48804884

48814885
<row>

‎src/backend/catalog/information_schema.sql

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2003-2009, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.60 2009/12/07 05:22:21 tgl Exp $
7+
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.61 2009/12/3022:48:10 petere Exp $
88
*/
99

1010
/*
@@ -1909,7 +1909,12 @@ CREATE VIEW triggers AS
19091909
CAST(n.nspnameAS sql_identifier)AS event_object_schema,
19101910
CAST(c.relnameAS sql_identifier)AS event_object_table,
19111911
CAST(nullAS cardinal_number)AS action_order,
1912-
CAST(nullAS character_data)AS action_condition,
1912+
-- XXX strange hacks follow
1913+
CAST(
1914+
CASE WHEN pg_has_role(c.relowner,'USAGE')
1915+
THEN (SELECT m[1]FROM regexp_matches(pg_get_triggerdef(t.oid), E'.{35,} WHEN\\((.+)\\) EXECUTE PROCEDURE')AS rm(m)LIMIT1)
1916+
ELSEnull END
1917+
AS character_data)AS action_condition,
19131918
CAST(
19141919
substring(pg_get_triggerdef(t.oid)from
19151920
position('EXECUTE PROCEDURE'insubstring(pg_get_triggerdef(t.oid)from48))+47)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp