xref: /PHP-8.4/ext/pgsql/tests/06copy.phpt (revision c15988aa)
1--TEST--
2PostgreSQL copy functions
3--EXTENSIONS--
4pgsql
5--SKIPIF--
6<?php include("inc/skipif.inc"); ?>
7--FILE--
8<?php
9
10include('inc/config.inc');
11$table_name = "table_06copy";
12
13$db = pg_connect($conn_str);
14pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
15
16$rows = pg_copy_to($db, $table_name);
17
18pg_query($db, "DELETE FROM $table_name");
19
20pg_copy_from($db, $table_name, $rows);
21
22echo "OK";
23
24?>
25--CLEAN--
26<?php
27include('inc/config.inc');
28$table_name = "table_06copy";
29
30$db = pg_connect($conn_str);
31pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
32?>
33--EXPECT--
34OK
35