Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > 703d980c580707c382b4e43e25965bc5 > files > 3715

php-manual-pt_BR-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>pg_parameter_status</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Manual do PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="PostgreSQL"
HREF="ref.pgsql.html"><LINK
REL="PREVIOUS"
TITLE="pg_options"
HREF="function.pg-options.html"><LINK
REL="NEXT"
TITLE="pg_pconnect"
HREF="function.pg-pconnect.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual do PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.pg-options.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.pg-pconnect.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.pg-parameter-status"
></A
>pg_parameter_status</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN182024"
></A
><P
>    (PHP 5)</P
>pg_parameter_status&nbsp;--&nbsp;Looks up a current parameter setting of the server.</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182027"
></A
><H2
>Descrição</H2
>string <B
CLASS="methodname"
>pg_parameter_status</B
> ( resource connection, string param_name )<BR
></BR
>string <B
CLASS="methodname"
>pg_parameter_status</B
> ( string param_name )<BR
></BR
><P
>&#13;    Looks up a current parameter setting of the server.
  </P
><P
>&#13;    Certain parameter values are reported by the server automatically at 
    connection startup or whenever their values change. <B
CLASS="function"
>pg_parameter_status()</B
> can be 
    used to interrogate these settings. It returns the current value of a 
    parameter if known, or <TT
CLASS="constant"
><B
>FALSE</B
></TT
> if the parameter is not known.
  </P
><P
>&#13;    Parameters reported as of PostgreSQL 8.0 include <TT
CLASS="literal"
>server_version</TT
>, 
    <TT
CLASS="literal"
>server_encoding</TT
>, <TT
CLASS="literal"
>client_encoding</TT
>, 
    <TT
CLASS="literal"
>is_superuser</TT
>, <TT
CLASS="literal"
>session_authorization</TT
>, 
    <TT
CLASS="literal"
>DateStyle</TT
>, <TT
CLASS="literal"
>TimeZone</TT
>, and <TT
CLASS="literal"
>integer_datetimes</TT
>.
    (<TT
CLASS="literal"
>server_encoding</TT
>, <TT
CLASS="literal"
>TimeZone</TT
>, and 
    <TT
CLASS="literal"
>integer_datetimes</TT
> were not reported by releases before 8.0.) Note that 
    <TT
CLASS="literal"
>server_version</TT
>, <TT
CLASS="literal"
>server_encoding</TT
> and <TT
CLASS="literal"
>integer_datetimes</TT
> 
    cannot change after PostgreSQL startup.
  </P
><P
>&#13;    PostgreSQL 7.3 or lower servers do not report parameter settings,
    <B
CLASS="function"
>pg_parameter_status()</B
>
    includes logic to obtain values for <TT
CLASS="literal"
>server_version</TT
> and 
    <TT
CLASS="literal"
>client_encoding</TT
>
    anyway. Applications are encouraged to use <B
CLASS="function"
>pg_parameter_status()</B
> rather than ad 
    hoc code to determine these values.
  </P
><DIV
CLASS="caution"
><P
></P
><TABLE
CLASS="caution"
BORDER="1"
WIDTH="100%"
><TR
><TD
ALIGN="CENTER"
><B
>Cuidado</B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
>&#13;      On a pre-7.4
      PostgreSQL server, changing <TT
CLASS="literal"
>client_encoding</TT
> via <TT
CLASS="literal"
>SET</TT
> after connection startup will 
      not be reflected by <B
CLASS="function"
>pg_parameter_status()</B
>.
     </P
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182073"
></A
><H2
>Parâmetros</H2
><P
>&#13;   <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><CODE
CLASS="parameter"
>connection</CODE
></DT
><DD
><P
>&#13;       PostgreSQL database connection resource.  When 
       <CODE
CLASS="parameter"
>connection</CODE
> is not present, the default connection 
       is used. The default connection is the last connection made by 
       <A
HREF="function.pg-connect.html"
><B
CLASS="function"
>pg_connect()</B
></A
> or <A
HREF="function.pg-pconnect.html"
><B
CLASS="function"
>pg_pconnect()</B
></A
>.
      </P
></DD
><DT
><CODE
CLASS="parameter"
>param_name</CODE
></DT
><DD
><P
>&#13;         Possible <CODE
CLASS="parameter"
>param_name</CODE
> values include <TT
CLASS="literal"
>server_version</TT
>, 
        <TT
CLASS="literal"
>server_encoding</TT
>, <TT
CLASS="literal"
>client_encoding</TT
>, 
        <TT
CLASS="literal"
>is_superuser</TT
>, <TT
CLASS="literal"
>session_authorization</TT
>, 
        <TT
CLASS="literal"
>DateStyle</TT
>, <TT
CLASS="literal"
>TimeZone</TT
>, and 
        <TT
CLASS="literal"
>integer_datetimes</TT
>.
        </P
></DD
></DL
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182099"
></A
><H2
>Valores de retornado</H2
><P
>A <A
HREF="language.types.string.html"
><B
CLASS="type"
>string</B
></A
> containing the value of the parameter, <TT
CLASS="constant"
><B
>FALSE</B
></TT
> on failure or invalid
  <CODE
CLASS="parameter"
>param_name</CODE
>.</P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182105"
></A
><H2
>Exemplos</H2
><P
>&#13;   <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN182108"
></A
><P
><B
>Exemplo 1. <B
CLASS="function"
>pg_parameter_status()</B
> example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br />&nbsp;&nbsp;$dbconn </font><font color="#007700">= </font><font color="#0000BB">pg_connect</font><font color="#007700">(</font><font color="#DD0000">"dbname=publisher"</font><font color="#007700">) or die(</font><font color="#DD0000">"Could not connect"</font><font color="#007700">);<br /><br />&nbsp;&nbsp;echo </font><font color="#DD0000">"Server encoding: "</font><font color="#007700">, </font><font color="#0000BB">pg_parameter_status</font><font color="#007700">(</font><font color="#0000BB">$dbconn</font><font color="#007700">, </font><font color="#DD0000">"server_encoding"</font><font color="#007700">);<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
><P
>O exemplo acima irá imprimir:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="screen"
>Server encoding: SQL_ASCII</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.pg-options.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Principal</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.pg-pconnect.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>pg_options</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.pgsql.html"
ACCESSKEY="U"
>Acima</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>pg_pconnect</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>