1
0
mirror of https://github.com/php/php-src.git synced 2026-04-08 16:43:44 +02:00
Files
archived-php-src/ext/pgsql/tests/07optional.phpt
David CARLIER dd8514a0bd ext/pgsql: adding pg_set_error_context_visibility.
another level of context for pg_last_error/pg_result_error() to include
or not the context in those. PQSHOW_CONTEXT_ERRORS being the default.

Close GH-11395
2023-06-13 18:07:39 +01:00

31 lines
755 B
PHP

--TEST--
PostgreSQL optional functions
--EXTENSIONS--
pgsql
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
// optional functions
include('config.inc');
$db = pg_connect($conn_str);
$enc = pg_client_encoding($db);
pg_set_client_encoding($db, $enc);
if (function_exists('pg_set_error_verbosity')) {
pg_set_error_verbosity($db, PGSQL_ERRORS_TERSE);
pg_set_error_verbosity($db, PGSQL_ERRORS_DEFAULT);
pg_set_error_verbosity($db, PGSQL_ERRORS_VERBOSE);
pg_set_error_verbosity($db, PGSQL_ERRORS_SQLSTATE);
}
pg_set_error_context_visibility($db, PGSQL_SHOW_CONTEXT_NEVER);
pg_set_error_context_visibility($db, PGSQL_SHOW_CONTEXT_ERRORS);
pg_set_error_context_visibility($db, PGSQL_SHOW_CONTEXT_ALWAYS);
echo "OK";
?>
--EXPECT--
OK