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

Commit5594d14

Browse files
committed
Add composite-type attributes to information_schema.element_types view
1 parentc533c14 commit5594d14

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

‎doc/src/sgml/information_schema.sgml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,7 @@
21472147

21482148
<para>
21492149
The view <literal>element_types</literal> contains the data type
2150-
descriptors of the elements of arrays. When a table column,
2150+
descriptors of the elements of arrays. When a table column, composite-type attribute,
21512151
domain, function parameter, or function return value is defined to
21522152
be of an array type, the respective information schema view only
21532153
contains <literal>ARRAY</literal> in the column
@@ -2212,9 +2212,11 @@ ORDER BY c.ordinal_position;
22122212
<entry>
22132213
The type of the object that uses the array being described: one
22142214
of <literal>TABLE</literal> (the array is used by a column of
2215-
that table), <literal>DOMAIN</literal> (the array is used by
2216-
that domain), <literal>ROUTINE</literal> (the array is used by
2217-
a parameter or the return data type of that function).
2215+
that table), <literal>USER-DEFINED TYPE</literal> (the array is
2216+
used by an attribute of that composite type),
2217+
<literal>DOMAIN</literal> (the array is used by that domain),
2218+
<literal>ROUTINE</literal> (the array is used by a parameter or
2219+
the return data type of that function).
22182220
</entry>
22192221
</row>
22202222

‎src/backend/catalog/information_schema.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,12 +2467,13 @@ CREATE VIEW element_types AS
24672467

24682468
FROM pg_namespace n, pg_type at, pg_namespace nbt, pg_type bt,
24692469
(
2470-
/* columns*/
2470+
/* columns, attributes*/
24712471
SELECTc.relnamespace, CAST(c.relnameAS sql_identifier),
2472-
'TABLE'::text,a.attnum,a.atttypid
2472+
CASE WHENc.relkind='c' THEN'USER-DEFINED TYPE'::text ELSE'TABLE'::text END,
2473+
a.attnum,a.atttypid
24732474
FROM pg_class c, pg_attribute a
24742475
WHEREc.oid=a.attrelid
2475-
ANDc.relkindIN ('r','v','f')
2476+
ANDc.relkindIN ('r','v','f','c')
24762477
AND attnum>0AND NOT attisdropped
24772478

24782479
UNION ALL

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp