-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog-pg-cast.html
More file actions
160 lines (160 loc) · 13.7 KB
/
catalog-pg-cast.html
File metadata and controls
160 lines (160 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>52.10. pg_cast</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="catalog-pg-auth-members.html" title="52.9. pg_auth_members" /><link rel="next" href="catalog-pg-class.html" title="52.11. pg_class" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="catalogs.html" title="第52章 システムカタログ">第52章 システムカタログ</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?template=bug_report.yml&what-happened=version 18.3 : catalog-pg-cast.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="catalog-pg-auth-members.html" title="52.9. pg_auth_members">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="第52章 システムカタログ">上へ</a></td><td width="60%" align="center">52.10. <code class="structname">pg_cast</code></td><td width="20%" align="right"> <a accesskey="n" href="catalog-pg-class.html" title="52.11. pg_class">次へ</a></td></tr></table><hr /></div><div class="sect1" id="CATALOG-PG-CAST"><div class="titlepage"><div><div><h2 class="title" style="clear: both">52.10. <code class="structname">pg_cast</code> <a href="#CATALOG-PG-CAST" class="id_link">#</a></h2></div></div></div><a id="id-1.10.4.12.2" class="indexterm"></a><p>
<span class="original">
The catalog <structname>pg_cast</structname> stores data type conversion
paths, both built-in and user-defined.
</span>
<code class="structname">pg_cast</code>カタログにはデータ型変換パスが格納されます。
ここには、組み込みのパスとユーザ定義のパスが存在します。
</p><p>
<span class="original">
It should be noted that <structname>pg_cast</structname> does not represent
every type conversion that the system knows how to perform; only those that
cannot be deduced from some generic rule. For example, casting between a
domain and its base type is not explicitly represented in
<structname>pg_cast</structname>. Another important exception is that
<quote>automatic I/O conversion casts</quote>, those performed using a data
type's own I/O functions to convert to or from <type>text</type> or other
string types, are not explicitly represented in
<structname>pg_cast</structname>.
</span>
<code class="structname">pg_cast</code>は、システムがどのように動作するかわかっているような、あらゆる型変換を表しているわけではないということに注意してください。
いくつかの一般的な規則から推測できないような型変換についてのみ表しています。
例えば、ドメインとその基本の型は明示的に<code class="structname">pg_cast</code>内で表されていません。
他の重要な例外は<span class="quote">「<span class="quote">自動I/O変換キャスト</span>」</span>です。
これらのキャストは、<code class="type">text</code>型やほかの文字列型から変換したりされたりするのにデータ型自身のI/O関数を用いていますが、これらのキャストは明示的に<code class="structname">pg_cast</code>内において表されていません。
</p><div class="table" id="id-1.10.4.12.5"><p class="title"><strong>表52.10 <code class="structname">pg_cast</code>の列</strong></p><div class="table-contents"><span class="original">
<title><structname>pg_cast</structname> Columns</title>
</span><table class="table" summary="pg_castの列" border="1"><colgroup><col /></colgroup><thead><tr><th class="catalog_table_entry"><p class="column_definition">
<span class="original">
Column Type
</span>
列 型
</p>
<p>
<span class="original">
Description
</span>
説明
</p></th></tr></thead><tbody><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">oid</code> <code class="type">oid</code>
</p>
<p>
<span class="original">
Row identifier
</span>
行識別子
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">castsource</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-type.html" title="52.64. pg_type"><code class="structname">pg_type</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
OID of the source data type
</span>
変換元データ型のOID
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">casttarget</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-type.html" title="52.64. pg_type"><code class="structname">pg_type</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
OID of the target data type
</span>
対象データ型のOID
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">castfunc</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
The OID of the function to use to perform this cast. Zero is
stored if the cast method doesn't require a function.
</span>
このキャストを実行するために使用する関数のOID。
キャストメソッドが関数を必要としない場合はゼロが格納されます。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">castcontext</code> <code class="type">char</code>
</p>
<p>
<span class="original">
Indicates what contexts the cast can be invoked in.
<literal>e</literal> means only as an explicit cast (using
<literal>CAST</literal> or <literal>::</literal> syntax).
<literal>a</literal> means implicitly in assignment
to a target column, as well as explicitly.
<literal>i</literal> means implicitly in expressions, as well as the
other cases.
</span>
キャストがどの文脈で呼び出し可能かを示します。
<code class="literal">e</code> = 明示のキャストとしてのみ起動されることを意味します(<code class="literal">CAST</code>または<code class="literal">::</code>構文を使用します)。
<code class="literal">a</code> = 対象となる列を明示的に特定するだけでなく暗黙的にも特定することを意味します。
<code class="literal">i</code> = 他の場合と同様に演算式内で暗黙的であることを意味します。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">castmethod</code> <code class="type">char</code>
</p>
<p>
<span class="original">
Indicates how the cast is performed.
<literal>f</literal> means that the function specified in the <structfield>castfunc</structfield> field is used.
<literal>i</literal> means that the input/output functions are used.
<literal>b</literal> means that the types are binary-coercible, thus no conversion is required.
</span>
どのようにキャストが実行されるかを示します。
<code class="literal">f</code> = <code class="structfield">castfunc</code>フィールド内で示される関数が使用されていることを意味します。
<code class="literal">i</code> = 入出力関数が使用されていることを示します。
<code class="literal">b</code> = 型がバイナリを強制しているため、変換が必要ないことを意味します。
</p></td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
The cast functions listed in <structname>pg_cast</structname> must
always take the cast source type as their first argument type, and
return the cast destination type as their result type. A cast
function can have up to three arguments. The second argument,
if present, must be type <type>integer</type>; it receives the type
modifier associated with the destination type, or -1
if there is none. The third argument,
if present, must be type <type>boolean</type>; it receives <literal>true</literal>
if the cast is an explicit cast, <literal>false</literal> otherwise.
</span>
<code class="structname">pg_cast</code>内に挙げられているキャスト関数は、第1番目の引数の型として、キャスト元の型をいつも取らなければいけません。
また、キャスト関数は、結果の型としてキャスト先の型を返します。
キャスト関数は3つまで引数を持つことができます。
もし存在するなら、2番目の引数は<code class="type">integer</code>型でなくてはなりません。
この引数はキャスト先の型に関連付けられた型修飾子を受け取ります。
2番目の引数がない場合は、-1です。
3番目の引数は、もし存在する場合は、<code class="type">boolean</code>型でなくてはなりません。
この引数は、もしキャストが明示的なキャストであれば<code class="literal">true</code>を受け取り、そうでない場合は<code class="literal">false</code>を受け取ります。
</p><p>
<span class="original">
It is legitimate to create a <structname>pg_cast</structname> entry
in which the source and target types are the same, if the associated
function takes more than one argument. Such entries represent
<quote>length coercion functions</quote> that coerce values of the type
to be legal for a particular type modifier value.
</span>
もし関連のある関数が複数の引数を持つ場合、キャストの元と先で型が同じである<code class="structname">pg_cast</code>項目を作成することが妥当です。
このような項目は、<span class="quote">「<span class="quote">length coercion functions</span>」</span>を表現します。
<span class="quote">「<span class="quote">length coercion functions</span>」</span>は型の値を特定の型の修飾子の値に適するように修正します。
</p><p>
<span class="original">
When a <structname>pg_cast</structname> entry has different source and
target types and a function that takes more than one argument, it
represents converting from one type to another and applying a length
coercion in a single step. When no such entry is available, coercion
to a type that uses a type modifier involves two steps, one to
convert between data types and a second to apply the modifier.
</span>
<code class="structname">pg_cast</code>項目が異なるキャスト元とキャスト先の型を持っていて、かつ関数が複数の引数を持つ時は、1つの型から別の型への変換し、かつ、1つの手順で長さの修正を適用することを意味します。
このような項目が利用できない時は、型修飾子を使用した型の修正は2つの手順が必要です。
1つはデータ型の間での変換で、2つ目は修飾子を適用することです。
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="catalog-pg-auth-members.html" title="52.9. pg_auth_members">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="catalogs.html" title="第52章 システムカタログ">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="catalog-pg-class.html" title="52.11. pg_class">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">52.9. <code class="structname">pg_auth_members</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> 52.11. <code class="structname">pg_class</code></td></tr></table></div></body></html>