Download src/php/php-src/ext/pgsql/tests/01createdb.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pgsql/tests/01createdb.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pgsql/tests/01createdb.phpt
-
curl -L -o 01createdb.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pgsql/tests/01createdb.phpt
1.24 kB
| --TEST-- | |
| PostgreSQL create db | |
| --EXTENSIONS-- | |
| pgsql | |
| --SKIPIF-- | |
| include("inc/skipif.inc"); | |
| --FILE-- | |
| // create test table | |
| include('inc/config.inc'); | |
| $table_name = 'table_01createdb'; | |
| $table_name_92 = 'table_01createdb_92'; | |
| $view_name = "view_01createdb"; | |
| $db = pg_connect($conn_str); | |
| if (!($q = @pg_query($db, "SELECT * FROM ".$table_name)) || !@pg_num_rows($q)) | |
| { | |
| pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); // Create table here | |
| } | |
| else { | |
| echo pg_last_error()."\n"; | |
| } | |
| $v = pg_version($db); | |
| if (version_compare($v['server'], '9.2', '>=') && (!($q = @pg_query($db, "SELECT * FROM ".$table_name_92)) || !@pg_num_rows($q))) | |
| { | |
| pg_query($db, "CREATE TABLE {$table_name_92} (textary text[], jsn json)"); // Create table here | |
| } | |
| else { | |
| echo pg_last_error()."\n"; | |
| } | |
| // Create view here | |
| pg_query($db, "CREATE VIEW {$view_name} AS SELECT * FROM {$table_name}"); | |
| pg_close($db); | |
| echo "OK"; | |
| --CLEAN-- | |
| include('inc/config.inc'); | |
| $table_name = 'table_01createdb'; | |
| $table_name_92 = 'table_01createdb_92'; | |
| $db = pg_connect($conn_str); | |
| pg_query($db, "DROP TABLE IF EXISTS {$table_name} cascade"); | |
| pg_query($db, "DROP TABLE IF EXISTS {$table_name_92} cascade"); | |
| --EXPECT-- | |
| OK | |