Skip to content

Commit f6e7dba

Browse files
committed
[reference/pgsql] sync with en
1 parent c045a04 commit f6e7dba

File tree

6 files changed

+45
-21
lines changed

6 files changed

+45
-21
lines changed

reference/pgsql/constants.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 63916fd88a875a56045117e2a60c723bc8e2ee19 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 3c6c95fcfd7d9eaa603df40327693ea8dff89d53 Maintainer: takagi Status: ready -->
44
<!-- Credits: mumumu -->
55
<appendix xml:id="pgsql.constants" xmlns="http://docbook.org/ns/docbook">
66
&reftitle.constants;
@@ -257,6 +257,22 @@
257257
</simpara>
258258
</listitem>
259259
</varlistentry>
260+
<varlistentry xml:id="constant.pgsql-tuples-chunk">
261+
<term>
262+
<constant>PGSQL_TUPLES_CHUNK</constant>
263+
(<type>int</type>)
264+
</term>
265+
<listitem>
266+
<simpara>
267+
<function>pg_result_status</function> から返されます。
268+
チャンクモードでコマンドは正常に終了し、データを返しました。
269+
<function>pg_set_chunked_rows_size</function> がせっていされた場合の
270+
<literal>SELECT</literal> コマンドがこの値を返します。
271+
結果セットは複数のチャンクに分割され、それぞれがあらかじめ決まった行数を持ちます。
272+
PHP 8.4.0 以降、かつ libpq 17 以降で利用可能です。
273+
</simpara>
274+
</listitem>
275+
</varlistentry>
260276
<varlistentry xml:id="constant.pgsql-copy-out">
261277
<term>
262278
<constant>PGSQL_COPY_OUT</constant>

reference/pgsql/examples.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: cffb5f52894aa8a29109e3802e2257c56b51bcb6 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: aa2e1accf0888a290a76b9193844d0d7b7bd40b8 Maintainer: takagi Status: ready -->
44
<!-- CREDITS: hirokawa,mumumu -->
55

66
<chapter xml:id="pgsql.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -15,13 +15,14 @@
1515
<programlisting role="php">
1616
<![CDATA[
1717
<?php
18+
1819
// 接続し、データベースを選択する
1920
$dbconn = pg_connect("host=localhost dbname=publishing user=www password=foo")
2021
or die('Could not connect: ' . pg_last_error());
2122
2223
// SQL クエリを実行する
2324
$query = 'SELECT * FROM authors';
24-
$result = pg_query($query) or die('Query failed: ' . pg_last_error());
25+
$result = pg_query($dbconn, $query) or die('Query failed: ' . pg_last_error());
2526
2627
// 結果を HTML で表示する
2728
echo "<table>\n";
@@ -39,6 +40,7 @@ pg_free_result($result);
3940
4041
// 接続をクローズする
4142
pg_close($dbconn);
43+
4244
?>
4345
]]>
4446
</programlisting>

reference/pgsql/functions/pg-lo-import.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
33
<!-- splitted from ./ja/functions/pgsql.xml, last change in rev 1.1 -->
4-
<!-- EN-Revision: c2eca73ef79ebe78cebb34053e41b565af504c4f Maintainer: hirokawa Status: ready -->
4+
<!-- EN-Revision: d0ae617680e58bde494f9d58d9c553e0a6944418 Maintainer: hirokawa Status: ready -->
55
<!-- CREDITS: takagi,mumumu -->
66
<refentry xml:id="function.pg-lo-import" xmlns="http://docbook.org/ns/docbook">
77
<refnamediv>
@@ -12,7 +12,7 @@
1212
<refsect1 role="description">
1313
&reftitle.description;
1414
<methodsynopsis>
15-
<type>int</type><methodname>pg_lo_import</methodname>
15+
<type>int|string|false</type><methodname>pg_lo_import</methodname>
1616
<methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
1717
<methodparam><type>string</type><parameter>pathname</parameter></methodparam>
1818
<methodparam choice="opt"><type>mixed</type><parameter>object_id</parameter></methodparam>

reference/pgsql/functions/pg-pconnect.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
33
<!-- splitted from ./ja/functions/pgsql.xml, last change in rev 1.1 -->
4-
<!-- EN-Revision: c2eca73ef79ebe78cebb34053e41b565af504c4f Maintainer: hirokawa Status: ready -->
4+
<!-- EN-Revision: 3b2503bdcbbffc9bd1381078ee06c298d4f8a49a Maintainer: hirokawa Status: ready -->
55
<!-- CREDITS: takagi -->
66
<refentry xml:id="function.pg-pconnect" xmlns="http://docbook.org/ns/docbook">
77
<refnamediv>
@@ -32,10 +32,10 @@
3232
<para>
3333
持続的接続を有効にするには、&php.ini; のディレクティブ <link
3434
linkend="ini.pgsql.allow-persistent">pgsql.allow_persistent</link>
35-
&quot;On&quot; に設定する必要があります(デフォルトは On です)。
35+
<literal>"On"</literal> に設定する必要があります(デフォルトは On です)。
3636
持続的接続の最大数は &php.ini; ディレクティブ <link
3737
linkend="ini.pgsql.max-persistent">pgsql.max_persistent</link>
38-
で設定可能です(デフォルトは制限無しを意味する -1 です)。
38+
で設定可能です(デフォルトは制限無しを意味する <literal>-1</literal> です)。
3939
接続全体の数は &php.ini; ディレクティブ <link
4040
linkend="ini.pgsql.max-links">pgsql.max_links</link> で設定可能です。
4141
</para>
@@ -62,7 +62,7 @@
6262
空の値や空白を含む値を指定する場合は、その値をシングルクォートで
6363
囲みます(例: <literal>keyword = 'a value'</literal>)。値の中に
6464
シングルクォートやバックスラッシュが含まれる場合は、それらを
65-
バックスラッシュでエスケープする必要があります(例: \' および \\)。
65+
バックスラッシュでエスケープする必要があります(例: <literal>\'</literal> および <literal>\\</literal>)。
6666
</para>
6767
<para>
6868
現在利用できるパラメータは以下のとおりです。
@@ -123,7 +123,7 @@
123123
</tgroup>
124124
</informaltable>
125125
</refsect1>
126-
126+
127127
<refsect1 role="examples">
128128
&reftitle.examples;
129129
<para>
@@ -132,18 +132,18 @@
132132
<programlisting role="php">
133133
<![CDATA[
134134
<?php
135-
$dbconn = pg_pconnect("dbname=mary");
136135
// "mary"という名前のデータベースに接続
136+
$dbconn = pg_pconnect("dbname=mary");
137137
138+
// "localhost" のポート "5432" にて "mary" という名前のデータベースに接続
138139
$dbconn2 = pg_pconnect("host=localhost port=5432 dbname=mary");
139-
// "localhost"のポート"5432"にて"mary"という名前のデータベースに接続
140140
141-
$dbconn3 = pg_pconnect("host=sheep port=5432 dbname=mary user=lamb password=foo");
142141
// ユーザー名とパスワードを指定してホスト"sheep"上の"mary"という名前のデータベースに接続
142+
$dbconn3 = pg_pconnect("host=sheep port=5432 dbname=mary user=lamb password=foo");
143143
144+
// ユーザー名とパスワードを指定してホスト"sheep"上の"test"という名前のデータベースへ接続
144145
$conn_string = "host=sheep port=5432 dbname=test user=lamb password=bar";
145146
$dbconn4 = pg_pconnect($conn_string);
146-
// ユーザー名とパスワードを指定してホスト"sheep"上の"test"という名前のデータベースへ接続
147147
?>
148148
]]>
149149
</programlisting>

reference/pgsql/functions/pg-result-status.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
33
<!-- splitted from ./ja/functions/pgsql.xml, last change in rev 1.31 -->
4-
<!-- EN-Revision: c2eca73ef79ebe78cebb34053e41b565af504c4f Maintainer: hirokawa Status: ready -->
4+
<!-- EN-Revision: 3c6c95fcfd7d9eaa603df40327693ea8dff89d53 Maintainer: hirokawa Status: ready -->
55
<!-- CREDITS: takagi -->
66
<refentry xml:id="function.pg-result-status" xmlns="http://docbook.org/ns/docbook">
77
<refnamediv>
@@ -56,10 +56,9 @@
5656
<para>
5757
<constant>PGSQL_STATUS_LONG</constant> が指定された場合の戻り値は
5858
以下のいずれかです。
59-
<constant>PGSQL_EMPTY_QUERY</constant>、
60-
<constant>PGSQL_COMMAND_OK</constant>、<constant>PGSQL_TUPLES_OK</constant>、<constant>PGSQL_COPY_OUT</constant>、
61-
<constant>PGSQL_COPY_IN</constant>、<constant>PGSQL_BAD_RESPONSE</constant>、<constant>PGSQL_NONFATAL_ERROR</constant>
62-
および <constant>PGSQL_FATAL_ERROR</constant> 。
59+
<constant>PGSQL_EMPTY_QUERY</constant>,
60+
<constant>PGSQL_COMMAND_OK</constant>, <constant>PGSQL_TUPLES_OK</constant>, <constant>PGSQL_TUPLES_CHUNK</constant>, <constant>PGSQL_COPY_OUT</constant>,
61+
<constant>PGSQL_COPY_IN</constant>, <constant>PGSQL_BAD_RESPONSE</constant>, <constant>PGSQL_NONFATAL_ERROR</constant>, <constant>PGSQL_FATAL_ERROR</constant>。
6362
それ以外の場合は、PostgreSQL コマンドタグを含む文字列を返します。
6463
</para>
6564
</refsect1>

reference/pgsql/functions/pg-select.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 2fa74a5512c0a7d3eabe39b1060646fc32f253f5 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 18aa2012f6fa1e5b09733147e02911d16e06d4a1 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: takagi,mumumu -->
55
<refentry xml:id="function.pg-select" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -16,7 +16,7 @@
1616
<type class="union"><type>array</type><type>string</type><type>false</type></type><methodname>pg_select</methodname>
1717
<methodparam><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
1818
<methodparam><type>string</type><parameter>table_name</parameter></methodparam>
19-
<methodparam><type>array</type><parameter>conditions</parameter></methodparam>
19+
<methodparam choice="opt"><type>array</type><parameter>conditions</parameter><initializer>[]</initializer></methodparam>
2020
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>PGSQL_DML_EXEC</constant></initializer></methodparam>
2121
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>PGSQL_ASSOC</constant></initializer></methodparam>
2222
</methodsynopsis>
@@ -76,6 +76,7 @@
7676
テーブル <parameter>table_name</parameter>
7777
のフィールド名をキーに、
7878
取得対象となる行にマッチするデータを値にもつ配列。
79+
PHP 8.4.0 以降は、空の配列を指定した場合には条件は適用されなくなっています。それより前のバージョンでは、<parameter>conditions</parameter> が空の場合は、関数そのものが失敗していました。
7980
</para>
8081
</listitem>
8182
</varlistentry>
@@ -140,6 +141,12 @@
140141
</row>
141142
</thead>
142143
<tbody>
144+
<row>
145+
<entry>8.4.0</entry>
146+
<entry>
147+
<parameter>conditions</parameter> は、オプションになりました。
148+
</entry>
149+
</row>
143150
&pgsql.changelog.connection-object;
144151
<row>
145152
<entry>7.1.0</entry>

0 commit comments

Comments
 (0)