xref: /PHP-7.4/ext/pgsql/tests/06copy_2.phpt (revision be36bf5a)
1--TEST--
2PostgreSQL copy functions, part 2
3--SKIPIF--
4<?php include("skipif.inc"); ?>
5--FILE--
6<?php
7
8include('config.inc');
9
10$db = pg_connect($conn_str);
11
12pg_query($db, 'CREATE TABLE test_copy (x int)');
13
14pg_query($db, 'COPY test_copy FROM STDIN');
15
16pg_put_line($db, "1\n");
17pg_put_line($db, "\\N\n");
18pg_put_line($db, "\\.\n");
19pg_end_copy($db);
20
21var_dump(pg_fetch_all_columns(pg_query($db, 'SELECT * FROM test_copy ORDER BY 1')));
22
23pg_query($db, 'DROP TABLE test_copy');
24
25?>
26--EXPECT--
27array(2) {
28  [0]=>
29  string(1) "1"
30  [1]=>
31  NULL
32}
33