<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.pgsql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'PostgreSQL 函数',
    2 => 'PostgreSQL 函数',
  ),
  'up' => 
  array (
    0 => 'book.pgsql.php',
    1 => 'PostgreSQL',
  ),
  'prev' => 
  array (
    0 => 'pgsql.examples-queries.php',
    1 => 'Basic usage',
  ),
  'next' => 
  array (
    0 => 'function.pg-affected-rows.php',
    1 => 'pg_affected_rows',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/pgsql/reference.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/ref.pgsql.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ref.pgsql" class="reference">
 <h1 class="title">PostgreSQL 函数</h1>

 <div class="partintro">
  <div class="section" id="pgsql.notes">
  <h2 class="title">注释</h2>
   <blockquote class="note"><p><strong class="note">注意</strong>: 
    <p class="para">
     Not all functions are supported by all builds. It depends on your
     libpq (The PostgreSQL C client library) version and how libpq is
     compiled. If PHP PostgreSQL extensions are missing, then it is because
     your libpq version does not support them. 
    </p>
   </p></blockquote>  
   <blockquote class="note"><p><strong class="note">注意</strong>: 
    <p class="para">
     Most PostgreSQL functions accept <code class="parameter">connection</code> as
     the optional first parameter. If it is not provided, the last opened
     connection is used. If it doesn&#039;t exist, functions return <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
    </p>
   </p></blockquote>
   <blockquote class="note"><p><strong class="note">注意</strong>: 
    <p class="para">
     PostgreSQL automatically folds all identifiers (e.g. table/column names)
     to lower-case values at object creation time and at query time. 
     To force the use of mixed or upper case identifiers, you must escape
     the identifier using double quotes (&quot;&quot;).
    </p>
   </p></blockquote>
   <blockquote class="note"><p><strong class="note">注意</strong>: 
    <p class="para">
     PostgreSQL does not have special commands for fetching database schema
     information (eg. all the tables in the current database).  Instead, there
     is a standard schema named <code class="literal">information_schema</code> containing
     system views with all the necessary information, in an easily
     queryable form.  See the <a href="http://www.postgresql.org/docs/current/interactive/" class="link external">&raquo;&nbsp;PostgreSQL Documentation</a>
     for full details.  
    </p>
   </p></blockquote>
  </div>
 </div>






































































































































































































































































































































































































































































































































































































































































































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="function.pg-affected-rows.php">pg_affected_rows</a> — 返回受影响的记录数（元组）</li><li><a href="function.pg-cancel-query.php">pg_cancel_query</a> — 取消异步查询</li><li><a href="function.pg-client-encoding.php">pg_client_encoding</a> — 获取客户端编码</li><li><a href="function.pg-close.php">pg_close</a> — 关闭 PostgreSQL 连接</li><li><a href="function.pg-connect.php">pg_connect</a> — 打开 PostgreSQL 连接</li><li><a href="function.pg-connect-poll.php">pg_connect_poll</a> — 对正在进行尝试进行异步的 PostgreSQL 连接轮询其状态。</li><li><a href="function.pg-connection-busy.php">pg_connection_busy</a> — 获取连接是否繁忙</li><li><a href="function.pg-connection-reset.php">pg_connection_reset</a> — 重置连接（再次连接）</li><li><a href="function.pg-connection-status.php">pg_connection_status</a> — 获取连接状态</li><li><a href="function.pg-consume-input.php">pg_consume_input</a> — Reads input on the connection</li><li><a href="function.pg-convert.php">pg_convert</a> — 将关联的数组值转换为适合 SQL 语句的格式</li><li><a href="function.pg-copy-from.php">pg_copy_from</a> — 将数组中的记录插入到表</li><li><a href="function.pg-copy-to.php">pg_copy_to</a> — 将表复制到数组</li><li><a href="function.pg-dbname.php">pg_dbname</a> — 获取数据库名称</li><li><a href="function.pg-delete.php">pg_delete</a> — 删除记录</li><li><a href="function.pg-end-copy.php">pg_end_copy</a> — 与 PostgreSQL 后端同步</li><li><a href="function.pg-escape-bytea.php">pg_escape_bytea</a> — 转义字符串以插入到 bytea 字段</li><li><a href="function.pg-escape-identifier.php">pg_escape_identifier</a> — Escape an identifier for insertion into a text field</li><li><a href="function.pg-escape-literal.php">pg_escape_literal</a> — Escape a literal for insertion into a text field</li><li><a href="function.pg-escape-string.php">pg_escape_string</a> — 转义字符串以供查询</li><li><a href="function.pg-execute.php">pg_execute</a> — Sends a request to execute a prepared statement with given parameters, and waits for the result</li><li><a href="function.pg-fetch-all.php">pg_fetch_all</a> — 从结果中获取所有行作为数组</li><li><a href="function.pg-fetch-all-columns.php">pg_fetch_all_columns</a> — Fetches all rows in a particular result column as an array</li><li><a href="function.pg-fetch-array.php">pg_fetch_array</a> — 获取一行作为数组</li><li><a href="function.pg-fetch-assoc.php">pg_fetch_assoc</a> — 获取一行作为关联数组</li><li><a href="function.pg-fetch-object.php">pg_fetch_object</a> — 获取一行作为对象</li><li><a href="function.pg-fetch-result.php">pg_fetch_result</a> — 从结果实例返回值</li><li><a href="function.pg-fetch-row.php">pg_fetch_row</a> — 提取一行作为枚举数组</li><li><a href="function.pg-field-is-null.php">pg_field_is_null</a> — 测试字段是否为 SQL NULL</li><li><a href="function.pg-field-name.php">pg_field_name</a> — 返回字段名</li><li><a href="function.pg-field-num.php">pg_field_num</a> — 返回名为 field 的字段编号</li><li><a href="function.pg-field-prtlen.php">pg_field_prtlen</a> — 返回打印的长度</li><li><a href="function.pg-field-size.php">pg_field_size</a> — 返回指定字段的内部存储大小</li><li><a href="function.pg-field-table.php">pg_field_table</a> — Returns the name or oid of the tables field</li><li><a href="function.pg-field-type.php">pg_field_type</a> — 返回相应字段编号的类型名称</li><li><a href="function.pg-field-type-oid.php">pg_field_type_oid</a> — Returns the type ID (OID) for the corresponding field number</li><li><a href="function.pg-flush.php">pg_flush</a> — 刷新链接中已处理的数据查询</li><li><a href="function.pg-free-result.php">pg_free_result</a> — 释放查询结果占用的内存</li><li><a href="function.pg-get-notify.php">pg_get_notify</a> — 获取 SQL NOTIFY 消息</li><li><a href="function.pg-get-pid.php">pg_get_pid</a> — 获取后端的进程 ID</li><li><a href="function.pg-get-result.php">pg_get_result</a> — 取得异步查询结果</li><li><a href="function.pg-host.php">pg_host</a> — 返回和某连接关联的主机名</li><li><a href="function.pg-insert.php">pg_insert</a> — 将数组插入到表中</li><li><a href="function.pg-last-error.php">pg_last_error</a> — 得到某连接的最后一条错误信息</li><li><a href="function.pg-last-notice.php">pg_last_notice</a> — 返回 PostgreSQL 服务器最新一条公告信息</li><li><a href="function.pg-last-oid.php">pg_last_oid</a> — 返回上一条记录的 oid</li><li><a href="function.pg-lo-close.php">pg_lo_close</a> — 关闭大对象</li><li><a href="function.pg-lo-create.php">pg_lo_create</a> — 新建大对象</li><li><a href="function.pg-lo-export.php">pg_lo_export</a> — 将大型对象导出到文件</li><li><a href="function.pg-lo-import.php">pg_lo_import</a> — 将文件导入为大型对象</li><li><a href="function.pg-lo-open.php">pg_lo_open</a> — 打开大对象</li><li><a href="function.pg-lo-read.php">pg_lo_read</a> — 读取大对象</li><li><a href="function.pg-lo-read-all.php">pg_lo_read_all</a> — 读取整个大对象并直接发送到浏览器</li><li><a href="function.pg-lo-seek.php">pg_lo_seek</a> — 在大对象中寻找位置</li><li><a href="function.pg-lo-tell.php">pg_lo_tell</a> — 返回当前大型对象的指针位置</li><li><a href="function.pg-lo-truncate.php">pg_lo_truncate</a> — Truncates a large object</li><li><a href="function.pg-lo-unlink.php">pg_lo_unlink</a> — 删除一个大型对象</li><li><a href="function.pg-lo-write.php">pg_lo_write</a> — 向大对象写入数据</li><li><a href="function.pg-meta-data.php">pg_meta_data</a> — 获得表的元数据</li><li><a href="function.pg-num-fields.php">pg_num_fields</a> — 返回结果中字段的数量</li><li><a href="function.pg-num-rows.php">pg_num_rows</a> — 返回结果中行的数量</li><li><a href="function.pg-options.php">pg_options</a> — 获得和 connection 相关的选项</li><li><a href="function.pg-parameter-status.php">pg_parameter_status</a> — Looks up a current parameter setting of the server</li><li><a href="function.pg-pconnect.php">pg_pconnect</a> — 打开一个持久的 PostgreSQL 连接</li><li><a href="function.pg-ping.php">pg_ping</a> — Ping 数据库连接</li><li><a href="function.pg-port.php">pg_port</a> — 返回 connection 相关的端口号</li><li><a href="function.pg-prepare.php">pg_prepare</a> — Submits a request to the server to create a prepared statement with the
   given parameters, and waits for completion</li><li><a href="function.pg-put-line.php">pg_put_line</a> — 向 PostgreSQL 后端发送以 NULL 字符结尾的字符串</li><li><a href="function.pg-query.php">pg_query</a> — 执行查询</li><li><a href="function.pg-query-params.php">pg_query_params</a> — Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text</li><li><a href="function.pg-result-error.php">pg_result_error</a> — 获得跟 result 相关的错误信息</li><li><a href="function.pg-result-error-field.php">pg_result_error_field</a> — Returns an individual field of an error report</li><li><a href="function.pg-result-memory-size.php">pg_result_memory_size</a> — Returns the amount of memory allocated for a query result</li><li><a href="function.pg-result-seek.php">pg_result_seek</a> — 在 result 实例中设定内部行偏移量</li><li><a href="function.pg-result-status.php">pg_result_status</a> — 获得查询结果的状态</li><li><a href="function.pg-select.php">pg_select</a> — 选择记录</li><li><a href="function.pg-send-execute.php">pg_send_execute</a> — Sends a request to execute a prepared statement with given parameters, without waiting for the result(s)</li><li><a href="function.pg-send-prepare.php">pg_send_prepare</a> — Sends a request to create a prepared statement with the given parameters, without waiting for completion</li><li><a href="function.pg-send-query.php">pg_send_query</a> — 发送异步查询</li><li><a href="function.pg-send-query-params.php">pg_send_query_params</a> — Submits a command and separate parameters to the server without waiting for the result(s)</li><li><a href="function.pg-set-chunked-rows-size.php">pg_set_chunked_rows_size</a> — Set the query results to be retrieved in chunk mode</li><li><a href="function.pg-set-client-encoding.php">pg_set_client_encoding</a> — 设定客户端编码</li><li><a href="function.pg-set-error-context-visibility.php">pg_set_error_context_visibility</a> — Determines the visibility of the context's error messages returned by pg_last_error
   and pg_result_error</li><li><a href="function.pg-set-error-verbosity.php">pg_set_error_verbosity</a> — Determines the verbosity of messages returned by pg_last_error 
   and pg_result_error</li><li><a href="function.pg-socket.php">pg_socket</a> — Get a read only handle to the socket underlying a PostgreSQL connection</li><li><a href="function.pg-trace.php">pg_trace</a> — 启用 PostgreSQL 连接的追踪</li><li><a href="function.pg-transaction-status.php">pg_transaction_status</a> — Returns the current in-transaction status of the server</li><li><a href="function.pg-tty.php">pg_tty</a> — 返回跟连接相关的 tty 名</li><li><a href="function.pg-unescape-bytea.php">pg_unescape_bytea</a> — 反转义 bytea 类型的二进制数据</li><li><a href="function.pg-untrace.php">pg_untrace</a> — 禁用 PostgreSQL 连接的追踪</li><li><a href="function.pg-update.php">pg_update</a> — 更新表</li><li><a href="function.pg-version.php">pg_version</a> — Returns an array with client, protocol and server version (when available)</li></ul>
</div>
<?php manual_footer($setup); ?>