From: <tr...@us...> - 2002-09-11 09:03:39
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv11914 Modified Files: pgsql.inc.php Log Message: added db_oper_like(), implemented dupKey Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pgsql.inc.php 10 Sep 2002 23:01:42 -0000 1.13 --- pgsql.inc.php 11 Sep 2002 09:03:36 -0000 1.14 *************** *** 48,53 **** function dupKey() { ! // Need to figure out how to do this. ! return false; } } --- 48,53 ---- function dupKey() { ! return ereg("^ERROR: Cannot insert a duplicate key into unique index", ! pg_last_error()); } } *************** *** 261,265 **** // order or what columns to use. All the table's columns must be included // and in the exact same order they're in in the database. Thus there's ! // also no way to ue the default values. function db_tabfile_load($filename, $table, $columns) { --- 261,265 ---- // order or what columns to use. All the table's columns must be included // and in the exact same order they're in in the database. Thus there's ! // also no way to use the default values. function db_tabfile_load($filename, $table, $columns) { *************** *** 277,284 **** $added++; else - { $err = 1; - error_log("offending line: $f[$i]"); - } } pg_put_line("\\.\n"); --- 277,281 ---- *************** *** 311,318 **** { $query = "DROP TABLE $table"; ! if(!@pg_query($query) && ! pg_last_error() != "ERROR: table \"$table\" does not exist") { ! error_log("PostgresSQL query failed: \"".$query."\" : ".rtrim(pg_last_error())); return false; } --- 308,316 ---- { $query = "DROP TABLE $table"; ! if(!@pg_query($query) && !strcasecmp(pg_last_error(), ! "ERROR: table \"$table\" does not exist")) { ! error_log("PostgresSQL query failed: \"".$query."\" : ". ! rtrim(pg_last_error())); return false; } *************** *** 419,422 **** --- 417,425 ---- { return ""; + } + + function db_oper_like() + { + return "ILIKE"; } |