Apparently this function does not return the database name given in the connection string. I tried this on apache 2.x/php4.3.x/pg7.4.x and apache 1.3.x/php5.x/pg8rc1 and saw this behavior on both setups.(PHP 4, PHP 5, PHP 7, PHP 8)
pg_options — Devuelve las opciones de PostgreSQL
pg_options() devuelve un string que contiene
las opciones de la conexión PostgreSQL connection.
connection
Una instancia PgSql\Connection.
Cuando connection es null, se usa la conexión por defecto.
La conexión por defecto es la última conexión hecha por
pg_connect() o pg_pconnect()
Desde PHP 8.1.0, usar la conexión por defecto está obsoleto.
Un string que contiene las opciones de connection.
| Versión | Descripción |
|---|---|
| 8.1.0 |
El parámetro connection ahora espera una instancia de
PgSql\Connection ; anteriormente, se esperaba un resource.
|
| 8.0.0 |
connection ahora es nullable.
|
Ejemplo #1 Ejemplo con pg_options()
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
echo pg_options($pgsql_conn);
?>Apparently this function does not return the database name given in the connection string. I tried this on apache 2.x/php4.3.x/pg7.4.x and apache 1.3.x/php5.x/pg8rc1 and saw this behavior on both setups.