summaryrefslogtreecommitdiff
path: root/it_dbi_postgres.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_dbi_postgres.class')
-rw-r--r--it_dbi_postgres.class27
1 files changed, 14 insertions, 13 deletions
diff --git a/it_dbi_postgres.class b/it_dbi_postgres.class
index 7ea3139..6ca4b50 100644
--- a/it_dbi_postgres.class
+++ b/it_dbi_postgres.class
@@ -22,7 +22,7 @@
class it_dbi_postgres extends it_dbi
{
-static $_global_key = 'it_dbi_postgres'; // override base class to get our own singleton
+static $_global_key = 'it_dbi_postgres'; # Override base class to get our own singleton
function _where($params)
{
@@ -59,7 +59,7 @@ function _get_field_defs()
list($table_name, $table_schema) = array_reverse(explode('.', $this->_p['table'], 2));
$where = $this->_where(['t.table_name' => $table_name, 't.table_schema' => $table_schema ?: 'public', 't.table_catalog' => $this->_p['db']]);
- // recreate Key column of mysql show columns
+ # Recreate Key column of mysql show columns
$res = $this->query('SELECT column_name,constraint_type,ordinal_position FROM information_schema.table_constraints AS t JOIN information_schema.key_column_usage USING (constraint_name, constraint_schema, constraint_catalog) ' . $where);
while ($res && ($row = $this->_fetch_assoc($res)))
{
@@ -126,17 +126,18 @@ function _query($query, $p)
$this->_affectedrows = pg_affected_rows($result);
$this->_insertid = $isinsert ? $this->_fetch_assoc($result)[$this->_p['keyfield']] : 0;
- // TODO probably PGSQl_NOTICE_ALL
- // if (($warning = $this->_link->get_warnings()))
- // {
- // do {
- // if (!it::match(trim($this->_p['ignored_warnings'] . "|1364|1261|1051|1062", "|"), $warning->errno))
- // $messages[] = $warning->message . " [error $warning->errno]";
- // } while ($warning->next() && ++$checked < 20);
-
- // if ($messages)
- // it::error(['title' => "Mysql warning: " . $messages[0], 'body' => "$query\n\n" . join("\n", $messages) . "\n"]);
- // }
+ /* TODO probably PGSQl_NOTICE_ALL
+ if (($warning = $this->_link->get_warnings()))
+ {
+ do {
+ if (!it::match(trim($this->_p['ignored_warnings'] . "|1364|1261|1051|1062", "|"), $warning->errno))
+ $messages[] = $warning->message . " [error $warning->errno]";
+ } while ($warning->next() && ++$checked < 20);
+
+ if ($messages)
+ it::error(['title' => "Mysql warning: " . $messages[0], 'body' => "$query\n\n" . join("\n", $messages) . "\n"]);
+ }
+ */
return $result;
}