mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 01:42:09 +01:00
161 lines
4.5 KiB
XML
161 lines
4.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: c2eca73ef79ebe78cebb34053e41b565af504c4f Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="function.pg-last-notice" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>pg_last_notice</refname>
|
|
<refpurpose>
|
|
Retourne la dernière note du serveur PostgreSQL
|
|
</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>array</type><type>string</type><type>bool</type></type><methodname>pg_last_notice</methodname>
|
|
<methodparam><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>PGSQL_NOTICE_LAST</constant></initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>pg_last_notice</function> retourne la dernière note du
|
|
serveur PostgreSQL sur la connexion <parameter>connection</parameter>
|
|
spécifiée. Le serveur PostgreSQL envoie des notes dans plusieurs cas,
|
|
par exemple lors de création d'une colonne <literal>SERIAL</literal> dans
|
|
une table.
|
|
</para>
|
|
<para>
|
|
Avec <function>pg_last_notice</function>, vous pouvez éviter des requêtes
|
|
inutiles en vérifiant si des notes sont liées ou pas à votre transaction.
|
|
</para>
|
|
<para>
|
|
Le suivi des notes peut être rendu optionnel en mettant à 1 la
|
|
directive de configuration <literal>pgsql.ignore_notice</literal> du
|
|
fichier &php.ini;.
|
|
</para>
|
|
<para>
|
|
L'enregistrement des notes peut être rendu optionnel en mettant la directive
|
|
de configuration <literal>pgsql.log_notice</literal> du &php.ini; à 0.
|
|
À moins que <literal>pgsql.ignore_notice</literal> ne soit à 0, les notes
|
|
ne seront pas enregistrées.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>connection</parameter></term>
|
|
<listitem>
|
|
&pgsql.parameter.connection;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
L'un de <constant>PGSQL_NOTICE_LAST</constant> (pour retourner la dernière note),
|
|
<constant>PGSQL_NOTICE_ALL</constant> (pour retourner toutes les notes),
|
|
or <constant>PGSQL_NOTICE_CLEAR</constant> (pour effacer les notes).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Une &string; contenant la dernière note sur la connexion
|
|
<parameter>connection</parameter> avec
|
|
<constant>PGSQL_NOTICE_LAST</constant>,
|
|
un &array; avec <constant>PGSQL_NOTICE_ALL</constant>,
|
|
un &boolean; avec <constant>PGSQL_NOTICE_CLEAR</constant>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
&pgsql.changelog.connection-object;
|
|
<row>
|
|
<entry>7.1.0</entry>
|
|
<entry>
|
|
Le paramètre <parameter>mode</parameter> a été ajouté.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>pg_last_notice</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$pgsql_conn = pg_connect("dbname=mark host=localhost");
|
|
|
|
$res = pg_query("CREATE TABLE test (id SERIAL)");
|
|
|
|
$notice = pg_last_notice($pgsql_conn);
|
|
|
|
echo $notice;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
CREATE TABLE will create implicit sequence "test_id_seq" for "serial" column "test.id"
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>pg_query</function></member>
|
|
<member><function>pg_last_error</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|