pg_untrace

(PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8)

pg_untrace — Disable tracing of a PostgreSQL connection

Опис

function pg_untrace(?PgSql\Connection $connection = null): true

Stop tracing started by pg_trace().

Параметри

connection

Примірник PgSql\Connection. Якщо параметр connection — null, то виконується стандартне з'єднання, тобто останнє, виконане функцією pg_connect() або pg_pconnect().

Увага

Починаючи з PHP 8.1.0, використання стандартного з'єднання є застарілим.

Значення, що повертаються

Завжди повертає true.

Журнал змін

Версія Опис
8.3.0 The return type is true now; previously, it was bool.
8.1.0 Тепер параметр connection має бути примірником PgSql\Connection. Раніше очікувався resource.
8.0.0 connection is now nullable.

Приклади

Приклад #1 pg_untrace() example

<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");

if ($pgsql_conn) {
   pg_trace('/tmp/trace.log', 'w', $pgsql_conn);
   pg_query("SELECT 1");
   pg_untrace($pgsql_conn);
   // Now tracing of backend communication is disabled
} else {
   print pg_last_error($pgsql_conn);
   exit;
}
?>

Прогляньте також

  • pg_trace() - Enable tracing a PostgreSQL connection

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top