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