php-src/ext/pgsql/tests/06copy_2.phpt
2021-10-05 17:43:48 +02:00

33 lines
541 B
PHP

--TEST--
PostgreSQL copy functions, part 2
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
include('config.inc');
$db = pg_connect($conn_str);
pg_query($db, 'CREATE TABLE test_copy (x int)');
pg_query($db, 'COPY test_copy FROM STDIN');
pg_put_line($db, "1\n");
pg_put_line($db, "\\N\n");
pg_put_line($db, "\\.\n");
pg_end_copy($db);
var_dump(pg_fetch_all_columns(pg_query($db, 'SELECT * FROM test_copy ORDER BY 1')));
pg_query($db, 'DROP TABLE test_copy');
?>
--EXPECT--
array(2) {
[0]=>
string(1) "1"
[1]=>
NULL
}