mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Readding previous English version
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@81109 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
a735a35092
commit
e547a14e05
1 changed files with 83 additions and 87 deletions
|
@ -1,61 +1,58 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- EN-Revision: 1.3 Maintainer: phaser Status: ready -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<reference id="ref.pgsql">
|
||||
<title>Funções PostgreSQL</title>
|
||||
<title>PostgreSQL functions</title>
|
||||
<titleabbrev>PostgreSQL</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
<para>
|
||||
Postgres, desenvolvida originalmente no Deparetamento de Ciências
|
||||
de Computação de Berkeley, foi pioneira em muitos dos conceitos de
|
||||
relacionamento-objeto que agora estão tornando-se disponíveis em
|
||||
alguns bancos de dados comerciais. Ele fornece suporte a linguagem
|
||||
SQL92/SQL99, integridade de transações e extensibilidade de tipos.
|
||||
Postgres é um descendente em código aberto do código original de
|
||||
Berkeley.
|
||||
Postgres, developed originally in the UC Berkeley Computer Science
|
||||
Department, pioneered many of the object-relational concepts now
|
||||
becoming available in some commercial databases. It provides
|
||||
SQL92/SQL99 language support, transaction integrity and type
|
||||
extensibility. PostgreSQL is an open source descendant of this
|
||||
original Berkeley code.
|
||||
</para>
|
||||
<para>
|
||||
O banco de dados PostgreSQL é um produto Open Source disponível
|
||||
sem nenhum custo. Para usar o suporte a PostgreSQL você precisa
|
||||
do PostgreSQL 6.5 ou superior. PostgreSQL 7.0 ou superior para
|
||||
habilitar todas as funções do módulo PostgreSQL. PostgreSQL suporta
|
||||
muitos códigos de caracteres incluindo a codificação de carcateres
|
||||
multibyte. A versão atual e maiores informações sobre PostgreSQL
|
||||
está disponível em <ulink url="&url.pgsql;">&url.pgsql;</ulink>.
|
||||
PostgreSQL database is Open Source product and available without
|
||||
cost. To use PostgreSQL support, you need PostgreSQL 6.5 or
|
||||
later. PostgreSQL 7.0 or later to enable all PostgreSQL module
|
||||
feature. PostgreSQL supports many character encoding including
|
||||
multibyte character encoding. The current version and more
|
||||
information about PostgreSQL is available at <ulink
|
||||
url="&url.pgsql;">&url.pgsql;</ulink>.
|
||||
</para>
|
||||
<para>
|
||||
Para habilitar o suporte a PostgreSQL a opção de configuração
|
||||
<option role="configure">--with-pgsql[=DIR]</option> é exigida quando
|
||||
você compila o PHP. Se o módulo compartilhado está disponível, o módulo
|
||||
PostgreSQL pode ser carregado usando a diretiva
|
||||
<link linkend="ini.extension">extension</link> no &php.ini; ou
|
||||
a função <function>dl</function>. Diretivas ini suportadas estão descritas
|
||||
em <filename>php.ini-dist</filename> que vem com a distribuição.
|
||||
In order to enable PostgreSQL support,
|
||||
<option role="configure">--with-pgsql[=DIR]</option> is required when you compile
|
||||
PHP. If shared object module is available, PostgreSQL module may
|
||||
be loaded using <link linkend="ini.extension">extension</link>
|
||||
directive in &php.ini; or <function>dl</function>
|
||||
function. Supported ini directives are described in
|
||||
<filename>php.ini-dist</filename> which comes with source distribution.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
Usar o módulo PostgreSQL com o PHP 4.0.6 não é recomendado devido a
|
||||
um bug no código de manipulação de mensagens de nota. Use o 4.1.0 ou
|
||||
superior.
|
||||
Using the PostgreSQL module with PHP 4.0.6 is not recommended due to
|
||||
a bug in the notice message handling code. Use 4.1.0 or later.
|
||||
</para>
|
||||
</warning>
|
||||
<warning>
|
||||
<para>
|
||||
Os nomes das funções PostgreSQL serão alterados na versão 4.2.0 para
|
||||
confirmar os padrões de programação atuais. A maioria dos novos nomes
|
||||
terão sublinhados adicionais, por exemplo pg_lo_open(). Algumas funções
|
||||
foram renomeadas para uma maior consistência, por exemplo pg_exec() que
|
||||
mudou para pg_query(). Os nomes antigos podem ser usados na 4.2.0 e em
|
||||
algumas poucas outras atualizações após esta, mas eles serão deletados em
|
||||
um futuro próximo.
|
||||
PostgreSQL function names will be changed in 4.2.0 release to
|
||||
confirm to current coding standards. Most of new names will have
|
||||
additional underscores, e.g. pg_lo_open(). Some functions are
|
||||
renamed to different name for consistency. e.g. pg_exec() to
|
||||
pg_query(). Older names can be used in 4.2.0 and a few releases
|
||||
from 4.2.0, but they may be deleted in the future.
|
||||
</para>
|
||||
<table>
|
||||
<title>Nomes de funções alterados</title>
|
||||
<title>Function names changed</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nomes antigos</entry>
|
||||
<entry>Nomes novos</entry>
|
||||
<entry>Old name</entry>
|
||||
<entry>New name</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -147,33 +144,33 @@
|
|||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
A antiga sintaxe <function>pg_connect</function>/<function>pg_pconnect</function>
|
||||
será obsoleta para suportar conexões assíncronas no futoro. Por favor use
|
||||
a string de conexão para <function>pg_connect</function>
|
||||
e <function>pg_pconnect</function>.
|
||||
The old <function>pg_connect</function>/<function>pg_pconnect</function>
|
||||
syntax will be deprecated to support asynchronous connections in the
|
||||
future. Please use a connection string for <function>pg_connect</function>
|
||||
and <function>pg_pconnect</function>.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
Nem todas as funções são suportadas por todas as compilações. Isso vai
|
||||
depender da versão do seu libpq (A interface C do cliente PostgreSQL) e
|
||||
como o seu libpq foi compilado. Se há alguma função ausente, a libpq não
|
||||
suporta a característica exigida pela função.
|
||||
Not all functions are supported by all builds. It depends on your
|
||||
libpq (The PostgreSQL C Client interface) version and how libpq is
|
||||
compiled. If there is missing function, libpq does not support
|
||||
the feature required for the function.
|
||||
</para>
|
||||
<para>
|
||||
Também é importante que você use uma libpq mais nova do que a que o
|
||||
servidor espera. Se você usar uma libpq mais antiga do que a que o
|
||||
servidor espera você poderá ter problemas.
|
||||
It is also important that you use newer libpq than PostgreSQL
|
||||
Server to be connected. If you use libpq older than PostgreSQL
|
||||
Server expects, you may have problems.
|
||||
</para>
|
||||
<para>
|
||||
Desde a versão 6.3 (03/02/1998) PostgreSQL usa sockets de domínio unix por
|
||||
padrão. A porta TCP não será aberta por padrão. Uma tabela é mostrada
|
||||
abaixo descrevendo essas novas possibilidades de conexão. Este socket será
|
||||
encontrado em <filename>/tmp/.s.PGSQL.5432</filename>.
|
||||
Espa opção pode ser habilitada com a chave '-i' para o
|
||||
<command>postmaster</command> e seu significado é: "escute em sockets
|
||||
TCP/IP assim como em sockets de domínio Unix".
|
||||
Since version 6.3 (03/02/1998) PostgreSQL uses unix domain sockets
|
||||
by default. TCP port will NOT be opened by default. A table is
|
||||
shown below describing these new connection possibilities. This
|
||||
socket will be found in <filename>/tmp/.s.PGSQL.5432</filename>.
|
||||
This option can be enabled with the '-i' flag to
|
||||
<command>postmaster</command> and it's meaning is: "listen on
|
||||
TCP/IP sockets as well as Unix domain sockets".
|
||||
<table>
|
||||
<title>Postmaster e PHP</title>
|
||||
<title>Postmaster and PHP</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
|
@ -213,35 +210,34 @@
|
|||
</table>
|
||||
</para>
|
||||
<para>
|
||||
Uma conexão com o servidor PostgreSQL pode ser estabelecida com os
|
||||
seguintes pares de valores definidos na string de comando: <command>$conn =
|
||||
pg_connect("host=meuHost port=minhaPorta tty=meuTTY options=minhasOpcoes
|
||||
dbname=meuDB user=meuUsuario password=minhaSenha ");
|
||||
A connection to PostgreSQL server can be established with the
|
||||
following value pairs set in the command string: <command>$conn =
|
||||
pg_connect("host=myHost port=myPort tty=myTTY options=myOptions
|
||||
dbname=myDB user=myUser password=myPassword ");
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
A sintaxe anterior de:
|
||||
The previous syntax of:
|
||||
<command>
|
||||
$conn = pg_connect ("host", "porta", "opcoes", "tty", "nomebd")
|
||||
$conn = pg_connect ("host", "port", "options", "tty", "dbname")
|
||||
</command>
|
||||
está obsoleta.
|
||||
has been deprecated.
|
||||
</para>
|
||||
<para>
|
||||
Variáveis de ambiente afetam o comportamento do servidor/cliente
|
||||
PostgreSQL. Por exemplo, o módulo PostgreSQL irá procurar pela variável de
|
||||
ambiente PGHOST quando o nome de host é omitido na string de conexão. As
|
||||
variáveis de ambiente suportadas variam de versão para versão. Vide o
|
||||
Manual de PRogramador do PostgreSQL (Programmer´s Manual) na seção libpq -
|
||||
Enviroment Variables para maiores detalhes.
|
||||
Environmental variables affect PostgreSQL server/client
|
||||
behavior. For example, PostgreSQL module will lookup PGHOST
|
||||
environment variable when the hostname is omitted in the connection
|
||||
string. Supported environment variables are different from version
|
||||
to version. Refer to PostgreSQL Programmer's Manual (libpq -
|
||||
Environment Variables) for details.
|
||||
</para>
|
||||
<para>
|
||||
Certifique-se que você definou as variáveis de ambiente para o usuário
|
||||
apropriado. Use <literal>$_ENV</literal> ou <function>getenv</function>
|
||||
para verificar que variáveis de ambiente estão disponíveis para o processo
|
||||
atual.
|
||||
Make sure you set environment variables for appropriate user. Use
|
||||
<literal>$_ENV</literal> or <function>getenv</function> to check
|
||||
which environment variables are available to the current process.
|
||||
</para>
|
||||
<example>
|
||||
<title>Definindo os parâmetros padrões</title>
|
||||
<title>Setting default parameters</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
PGHOST=psgql.exmaple.com
|
||||
|
@ -258,20 +254,20 @@ export PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD PGDATESTYLE PGTZ PGCLIENTENCOD
|
|||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
A partir do PostgreSQL 7.1.0, você pode armazenar até 1GB dentro de um
|
||||
campo do tipo texto. Em versões mais antigas, isto era limitado ao tamanho
|
||||
do bloco (padrão era 8KB e o máximo era 32KB definido em tempo de
|
||||
compilação)
|
||||
Starting with PostgreSQL 7.1.0, you can store up to 1GB into a
|
||||
field of type text. In older versions, this was limited to the block
|
||||
size (default was 8KB, maximum was 32KB, defined at compile time)
|
||||
</para>
|
||||
<para>
|
||||
Para usar a interface de objetos grandes (lo), é exigido que se encapsule
|
||||
as funções de objetos grandes dentro de um bloco de transação. Um bloco de
|
||||
transação inicia-se com a declaração SQL <command>BEGIN</command> e se a
|
||||
transação foi válida termina com <command>COMMIT</command> ou
|
||||
<command>END</command>. Se a transaão falhar, ela deve ser fechada com
|
||||
<command>ROLLBACK</command> ou <command>ABORT</command>.
|
||||
<>
|
||||
<title>Usando Objetos Grandes</title>
|
||||
To use the large object (lo) interface, it is required to enclose
|
||||
large object functions within a transaction block. A transaction
|
||||
block starts with a SQL statement <command>BEGIN</command> and if
|
||||
the transaction was valid ends with <command>COMMIT</command> or
|
||||
<command>END</command>. If the transaction fails the transaction
|
||||
should be closed with <command>ROLLBACK</command> or
|
||||
<command>ABORT</command>.
|
||||
<example>
|
||||
<title>Using Large Objects</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@ -288,8 +284,8 @@ export PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD PGDATESTYLE PGTZ PGCLIENTENCOD
|
|||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
Você não deve fechar a conexão com o servidor PostgreSQL antes de fechar o
|
||||
objeto grande.
|
||||
You should not close the connection to the PostgreSQL server
|
||||
before closing the large object.
|
||||
</para>
|
||||
</partintro>
|
||||
|
||||
|
|
Loading…
Reference in a new issue