-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog-pg-cast.html
More file actions
88 lines (88 loc) · 12 KB
/
Copy pathcatalog-pg-cast.html
File metadata and controls
88 lines (88 loc) · 12 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
<?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>51.10. pg_cast</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="catalog-pg-auth-members.html" title="51.9. pg_auth_members" /><link rel="next" href="catalog-pg-class.html" title="51.11. pg_class" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 10.5文書</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="第51章 システムカタログ">第51章 システムカタログ</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?title=version 10.5 catalog-pg-cast.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="catalog-pg-auth-members.html" title="51.9. pg_auth_members">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="第51章 システムカタログ">上へ</a></td><td width="60%" align="center">51.10. <code class="structname">pg_cast</code></td><td width="20%" align="right"> <a accesskey="n" href="catalog-pg-class.html" title="51.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">51.10. <code class="structname">pg_cast</code></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</>, those performed using a data
type's own I/O functions to convert to or from <type>text</> 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>表51.10 <code class="structname">pg_cast</code>の列</strong></p><div class="table-contents"><span class="original">
<title><structname>pg_cast</> Columns</title>
</span><table class="table" summary="pg_castの列" border="1"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th>名前</th><th>型</th><th>参照先</th><th>説明</th></tr></thead><tbody><tr><td><code class="structfield">oid</code></td><td><code class="type">oid</code></td><td> </td><td>行識別子(隠し属性です。明示的に選択しなければなりません)</td></tr><tr><td><code class="structfield">castsource</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-type.html" title="51.62. pg_type"><code class="structname">pg_type</code></a>.oid</code></td><td>変換元データ型のOID</td></tr><tr><td><code class="structfield">casttarget</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-type.html" title="51.62. pg_type"><code class="structname">pg_type</code></a>.oid</code></td><td>対象データ型のOID</td></tr><tr><td><code class="structfield">castfunc</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="51.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td><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。
キャストメソッドが関数を必要としない場合はゼロが格納されます。
</td></tr><tr><td><code class="structfield">castcontext</code></td><td><code class="type">char</code></td><td> </td><td><span class="original">
Indicates what contexts the cast can be invoked in.
<literal>e</> means only as an explicit cast (using
<literal>CAST</> or <literal>::</> syntax).
<literal>a</> means implicitly in assignment
to a target column, as well as explicitly.
<literal>i</> 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>は他の場合と同様に演算式内で暗黙的であることを意味します。
</td></tr><tr><td><code class="structfield">castmethod</code></td><td><code class="type">char</code></td><td> </td><td><span class="original">
Indicates how the cast is performed.
<literal>f</> means that the function specified in the <structfield>castfunc</> field is used.
<literal>i</> means that the input/output functions are used.
<literal>b</> 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>は型がバイナリを強制しているため、変換が必要ないことを意味します。
</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</>; 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</>; it receives <literal>true</>
if the cast is an explicit cast, <literal>false</> 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</> 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">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="catalogs.html">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="catalog-pg-class.html">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">51.9. <code class="structname">pg_auth_members</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html">ホーム</a></td><td width="40%" align="right" valign="top"> 51.11. <code class="structname">pg_class</code></td></tr></table></div></body></html>