/php-src/ext/pgsql/tests/ |
H A D | pg_delete_001.phpt | 12 $table_name = 'table_pg_delete_001'; 18 pg_query($conn, "CREATE TABLE {$table_name} (id INT, id2 INT)"); 21 pg_insert($conn, $table_name, array('id' => 1, 'id2' => 1)); 22 pg_insert($conn, $table_name, array('id' => 1, 'id2' => 2)); 23 pg_insert($conn, $table_name, array('id' => 1, 'id2' => 2)); 24 pg_insert($conn, $table_name, array('id' => 3, 'id2' => 3)); 31 pg_delete($conn, $table_name, array('id' => 1, 'id2' => 0)); 32 pg_delete($conn, $table_name, array('id' => 1, 'id2' => 2)); 51 $table_name = 'table_pg_delete_001'; 55 pg_query($conn, "DROP TABLE IF EXISTS {$table_name}"); [all …]
|
H A D | pg_update_001.phpt | 12 $table_name = 'table_pg_update_001'; 18 pg_query($conn, "CREATE TABLE {$table_name} (id INT, id2 INT)"); 19 pg_query($conn, "CREATE TABLE {$schema_name}.{$table_name} (id INT, id2 INT)"); 22 pg_insert($conn, $table_name, array('id' => 1, 'id2' => 1)); 23 pg_insert($conn, "{$schema_name}.{$table_name}", array('id' => 1, 'id2' => 2)); 25 pg_update($conn, $table_name, array('id' => 10), array('id' => 1)); 28 pg_update($conn, "{$schema_name}.{$table_name}", array('id' => 100), array('id2' => 2)); 31 $rs = pg_query($conn, "SELECT * FROM {$table_name} UNION SELECT * FROM {$schema_name}.{$table_name}… 41 $table_name = 'table_pg_update_001'; 45 pg_query($conn, "DROP TABLE IF EXISTS {$table_name}"); [all …]
|
H A D | bug77047.phpt | 14 $table_name = 'table_bug77047'; 18 pg_query($db, "CREATE TABLE {$table_name} ( 23 pg_insert($db, $table_name, array("t" => "13:31")); 27 pg_insert($db, $table_name, array("t" => "13:31:13")); 28 pg_insert($db, $table_name, array("t" => "1:2:3")); 30 pg_insert($db, $table_name, array("t" => "xyz")); 34 pg_insert($db, $table_name, array("t" => NULL)); 35 pg_insert($db, $table_name, array("t" => "")); 37 $res = pg_query($db, "SELECT t FROM {$table_name}"); 46 $table_name = 'table_bug77047'; [all …]
|
H A D | 15pg_delete.phpt | 12 $table_name = "table_15pg_delete"; 15 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 16 pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)"); 17 pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)"); 21 echo pg_delete($db, $table_name, $ids, PGSQL_DML_STRING)."\n"; 22 echo pg_delete($db, $table_name, $ids, PGSQL_DML_STRING|PGSQL_DML_ESCAPE)."\n"; 23 if (!pg_delete($db, $table_name, $ids)) { 33 $table_name = "table_15pg_delete"; 36 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 06copy.phpt | 11 $table_name = "table_06copy"; 14 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 16 $rows = pg_copy_to($db, $table_name); 18 pg_query($db, "DELETE FROM $table_name"); 20 pg_copy_from($db, $table_name, $rows); 28 $table_name = "table_06copy"; 31 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 14pg_update_9.phpt | 15 $table_name = "table_14pg_update_9"; 18 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 19 pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)"); 20 pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)"); 27 pg_update($db, $table_name, $fields, $ids) or print "Error in test 1\n"; 28 echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n"; 29 echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING|PGSQL_DML_ESCAPE)."\n"; 36 $table_name = "table_14pg_update_9"; 39 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 13pg_select_9.phpt | 15 $table_name = "table_13pg_select_9"; 19 pg_query($db, "INSERT INTO {$table_name} VALUES(1234, 'AAA', 'BBB')"); 20 pg_query($db, "INSERT INTO {$table_name} VALUES(1234, 'AAA', 'BBB')"); 26 $res = pg_select($db, $table_name, $ids) or print "Error\n"; 28 echo pg_select($db, $table_name, $ids, PGSQL_DML_STRING)."\n"; 33 $converted = pg_select($db, $table_name, [5 => 'AAA']); 38 $converted = pg_select($db, $table_name, ['AAA']); 43 $converted = pg_select($db, $table_name, ['num' => []]); 53 $converted = pg_select($db, $table_name, ['num' => $db]); 65 $table_name = "table_13pg_select_9"; [all …]
|
H A D | 12pg_insert_9.phpt | 15 $table_name = "table_12pg_insert_9"; 18 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 24 pg_insert($db, $table_name, $fields) or print "Error in test 1\n"; 25 echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n"; 27 var_dump( pg_insert($db, $table_name, $fields, PGSQL_DML_EXEC) ); 31 $converted = pg_insert($db, $table_name, [5 => 'AAA']); 36 $converted = pg_insert($db, $table_name, ['AAA']); 41 $converted = pg_insert($db, $table_name, ['num' => []]); 51 $converted = pg_insert($db, $table_name, ['num' => $db]); 62 $table_name = "table_12pg_insert_9"; [all …]
|
H A D | pg_insert_001.phpt | 12 $table_name = 'table_pg_insert_001'; 17 pg_query($conn, "CREATE TABLE {$schema_name}.{$table_name} (id INT, id2 INT)"); 20 pg_insert($conn, $table_name, array('id' => 1, 'id2' => 1)); 22 pg_insert($conn, "{$schema_name}.{$table_name}", array('id' => 1, 'id2' => 2)); 24 var_dump(pg_insert($conn, "{$schema_name}.{$table_name}", array('id' => 1, 'id2' => 2), PGSQL_DML_S… 26 var_dump(pg_select($conn, "{$schema_name}.{$table_name}", array('id' => 1))); 33 $table_name = 'table_pg_insert_001'; 36 pg_query($conn, "DROP TABLE IF EXISTS {$schema_name}.{$table_name}");
|
H A D | 23sync_query_params.phpt | 13 $table_name = "table_23sync_query_params"; 16 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 17 pg_query($db, "INSERT INTO {$table_name} (num) VALUES(1000)"); 19 $result = pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)); 42 pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); 43 pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); 51 $result = pg_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC"… 62 $table_name = "table_23sync_query_params"; 65 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | gh8253.phpt | 12 $table_name = 'table_gh8253'; 19 pg_query($db, "CREATE TABLE {$table_name} (bar text);"); 20 pg_insert($db, $table_name, $a); 21 $res = pg_query($db, "SELECT * FROM {$table_name}"); 27 $table_name = 'table_gh8253'; 30 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 80_bug39971.phpt | 13 $table_name = 'table_80_bug39971'; 17 pg_query($dbh, "CREATE TABLE {$table_name} (id SERIAL, tm timestamp NOT NULL)"); 20 pg_insert($dbh, $table_name, $values); 23 pg_update($dbh, $table_name, $values, $ids); 31 $table_name = 'table_80_bug39971'; 34 pg_query($dbh, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 06copy_2.phpt | 11 $table_name = 'table_06copy_2'; 15 pg_query($db, "CREATE TABLE {$table_name} (x int)"); 17 pg_query($db, "COPY {$table_name} FROM STDIN"); 24 var_dump(pg_fetch_all_columns(pg_query($db, "SELECT * FROM {$table_name} ORDER BY 1"))); 29 $table_name = 'table_06copy_2'; 32 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 10pg_convert_9.phpt | 15 $table_name = "table_10pg_convert_9"; 18 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 23 $converted = pg_convert($db, $table_name, $fields); 29 $converted = pg_convert($db, $table_name, [5 => 'AAA']); 34 $converted = pg_convert($db, $table_name, ['AAA']); 39 $converted = pg_convert($db, $table_name, ['num' => []]); 44 $converted = pg_convert($db, $table_name, ['num' => new stdClass()]); 49 $converted = pg_convert($db, $table_name, ['num' => $db]); 58 $table_name = "table_10pg_convert_9"; 61 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 80_bug42783.phpt | 13 $table_name = 'table_80_bug42783'; 20 pg_query($dbh, "CREATE TABLE {$table_name} (id SERIAL PRIMARY KEY, time TIMESTAMP NOT NULL DEFAULT … 22 pg_insert($dbh, $table_name, array()); 24 var_dump(pg_fetch_assoc(pg_query($dbh, "SELECT * FROM {$table_name}"))); 31 $table_name = 'table_80_bug42783'; 34 pg_query($dbh, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | bug37100_9.phpt | 14 $table_name = 'table_bug37100_9'; 18 pg_query($db, "CREATE TABLE {$table_name} (binfield byteA) ;"); 19 pg_query($db, "INSERT INTO {$table_name} VALUES (decode('0103AA000812','hex'))"); 22 $data = pg_query($db, "SELECT binfield FROM {$table_name}"); 27 $sql = "BEGIN; DECLARE mycursor BINARY CURSOR FOR SELECT binfield FROM {$table_name}; FETCH ALL IN … 45 $table_name = 'table_bug37100_9'; 48 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 25async_query_params.phpt | 13 $table_name = "table_25async_query_params"; 16 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 17 pg_query($db, "INSERT INTO {$table_name} (num) VALUES(1000)"); 19 if (!pg_send_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))) { 50 pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); 51 pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); 59 if (!pg_send_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC"… 73 $table_name = "table_25async_query_params"; 76 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 06_bug73498.phpt | 11 $table_name = "table_06_bug73498"; 15 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 16 pg_query($db, "CREATE VIEW {$view_name} as SELECT * FROM {$table_name}"); 17 pg_query($db, "INSERT INTO {$table_name} DEFAULT VALUES"); 28 $table_name = "table_06_bug73498"; 33 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 80_bug24499.phpt | 13 $table_name = 'table_80_bug24499'; 20 pg_query($dbh, "CREATE TABLE {$table_name} (id SERIAL, t INT)"); 23 pg_query($dbh, "INSERT INTO {$table_name} (t) VALUES ($i)"); 33 global $table_name; 35 $q = pg_query($dbh, "SELECT id FROM {$table_name}"); 55 $table_name = 'table_80_bug24499'; 58 pg_query($dbh, "DROP TABLE IF EXISTS {$table_name} CASCADE");
|
H A D | 32nb_async_query.phpt | 14 $table_name = "table_32nb_async_query"; 17 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 18 pg_query($db, "INSERT INTO {$table_name} DEFAULT VALUES"); 23 $nb_send = pg_send_query($db, "SELECT * FROM ".$table_name.";"); 52 pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";")); 53 pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";")); 61 $nb_send = pg_send_query($db, "INSERT INTO ".$table_name." VALUES (8888, 'GGG');"); 83 $table_name = "table_32nb_async_query"; 86 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 30nb_async_query_params.phpt | 14 $table_name = "table_30nb_async_query_params"; 17 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 18 pg_query($db, "INSERT INTO {$table_name} (num) VALUES(1000)"); 23 $sent = pg_send_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)); 51 pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); 52 pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); 60 $sent = pg_send_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'… 78 $table_name = "table_30nb_async_query_params"; 81 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | pg_copy_from_iterable.phpt | 11 $table_name = "table_copy_iter"; 14 pg_query($db, "CREATE TABLE {$table_name} (num int)"); 42 pg_copy_from($db, $table_name, new stdClass()); 46 var_dump(pg_copy_from($db, $table_name, $iter)); 47 $res = pg_query($db, "SELECT FROM {$table_name}"); 54 $table_name = "table_copy_iter"; 57 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 18pg_escape_bytea_hex.phpt | 15 $table_name = "table_18pg_escape_bytea_hex"; 18 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 25 pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');'); 26 $result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876'); 40 $table_name = "table_18pg_escape_bytea_hex"; 43 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 18pg_escape_bytea_esc.phpt | 12 $table_name = "table_18pg_escape_bytea_esc"; 15 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 22 pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');'); 23 $result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876'); 37 $table_name = "table_18pg_escape_bytea_esc"; 40 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|
H A D | 16pg_result_status.phpt | 10 $table_name = "table_16pg_result_status"; 13 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); 15 $sql = "SELECT * FROM ".$table_name." WHERE num = -2"; 24 $table_name = "table_16pg_result_status"; 27 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
|