mirror of
https://github.com/php/doc-es.git
synced 2026-04-23 23:28:22 +02:00
5b1dc40a56
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@78203 c90b9560-bf6c-de11-be94-00142212c4b1
153 lines
4.0 KiB
XML
153 lines
4.0 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<reference id="ref.pgsql">
|
|
<title>Funciones de PostgreSQL</title>
|
|
<titleabbrev>PostgreSQL</titleabbrev>
|
|
|
|
<partintro>
|
|
<para>
|
|
Postgres, desarrollado originalmente en el UC Berkeley Computer Science
|
|
Department, ha sido pionero en muchos de los conceptos relacionales/orientados
|
|
a objeto que ahora están empezando a estar disponibles en algunas bases de datos
|
|
comperciales. Tiene soporte de lenguaje SQL92/SQL3, integridad transaccional,
|
|
y extensibilidad de tipos. PostgreSQL es un descendiente de dominio público, más concretamente
|
|
open source, del código original de Berkeley.
|
|
</para>
|
|
<para>
|
|
PostgreSQL se encuentra disponible sin coste alguno. La versión actual la tienes a tu
|
|
disposición en <ulink url="&url.pgsql;">www.PostgreSQL.org</ulink>.
|
|
</para>
|
|
<para>
|
|
Desde la versión 6.3 (02/03/1998) PostgreSQL usa sockets tipo Unix. Abajo se da
|
|
una tabla con las diferentes posibilidades. El socket se encuentra en el ficheero
|
|
<filename>/tmp/.s.PGSQL.5432</filename>. Esta opción se controla mediante
|
|
el flag '-i' del <command>postmaster</command> y cuando se incluye significa
|
|
"escuchar sockets TCP/IP además de los de dominio Unix" ya que si no se le dice
|
|
nada solo escucha sockets tipo Unix.
|
|
<table>
|
|
<title>Postmaster y PHP</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Postmaster</entry>
|
|
<entry>PHP</entry>
|
|
<entry>Estado</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>postmaster &</entry>
|
|
<entry>pg_connect("", "", "", "", "dbname");</entry>
|
|
<entry>OK</entry>
|
|
</row>
|
|
<row>
|
|
<entry>postmaster -i &</entry>
|
|
<entry>pg_connect("", "", "", "", "dbname");</entry>
|
|
<entry>OK</entry>
|
|
</row>
|
|
<row>
|
|
<entry>postmaster &</entry>
|
|
<entry>pg_connect("localhost", "", "", "", "dbname");</entry>
|
|
<entry>
|
|
Unable to connect to PostgreSQL server: connectDB() failed:
|
|
Is the postmaster running and accepting TCP/IP (with -i)
|
|
connection at 'localhost' on port '5432'? in
|
|
/path/to/file.php3 on line 20.
|
|
(Imposible conectar al servidor PostgreSQL, la llamada connectDB() ha fallado:
|
|
¿Está funcionando el postmaster aceptando conextiones TCP/IP (con -i)
|
|
en 'localhost' en el puerto '5432'? en /path/to/file.php3 en linea 20.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>postmaster -i &</entry>
|
|
<entry>pg_connect("localhost", "", "", "", "dbname");</entry>
|
|
<entry>OK</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
<para>
|
|
Uno puede establecer una conexión con el siguiente comando:
|
|
</para>
|
|
<para>
|
|
Para usar el interface de objetos grandes (large object o lo), es necesario
|
|
encapsularlo en un bloque de transacción. Un bloque de transacción
|
|
empieza con un <command>begin</command> y si la transacción fue
|
|
valida termina con <command>commit</command> y <command>end</command>. Si la
|
|
transacción falla debe ser cerrada con
|
|
<command>abort</command> y <command>rollback</command>.
|
|
|
|
<example>
|
|
<title>Usando Objetos Grandes (lo)</title>
|
|
<programlisting role="php">
|
|
<?php
|
|
$database = pg_Connect ("", "", "", "", "jacarta");
|
|
pg_exec ($database, "begin");
|
|
$oid = pg_locreate ($database);
|
|
echo ("$oid\n");
|
|
$handle = pg_loopen ($database, $oid, "w");
|
|
echo ("$handle\n");
|
|
pg_lowrite ($handle, "gaga");
|
|
pg_loclose ($handle);
|
|
pg_exec ($database, "commit")
|
|
pg_exec ($database, "end")
|
|
?>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</partintro>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&reference.pgsql.functions;
|
|
|
|
</reference>
|
|
<!-- 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:"../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
-->
|
|
|