diff --git a/library/adodb/datadict/datadict-postgres.inc.php b/library/adodb/datadict/datadict-postgres.inc.php
index 10789bc..5c0f6ff 100644
--- a/library/adodb/datadict/datadict-postgres.inc.php
+++ b/library/adodb/datadict/datadict-postgres.inc.php
@@ -136,7 +136,7 @@ class ADODB2_postgres extends ADODB_DataDict {
if (($not_null = preg_match('/NOT NULL/i',$v))) {
$v = preg_replace('/NOT NULL/i','',$v);
}
- if (preg_match('/^([^ ]+) .*DEFAULT ([^ ]+)/',$v,$matches)) {
+ if (preg_match('/^([^ ]+) .*DEFAULT (\'[^\']+\'|\"[^\"]+\"|[^ ]+)/',$v,$matches)) {
list(,$colname,$default) = $matches;
$sql[] = $alter . str_replace('DEFAULT '.$default,'',$v);
$sql[] = 'UPDATE '.$tabname.' SET '.$colname.'='.$default;
@@ -201,7 +201,7 @@ class ADODB2_postgres extends ADODB_DataDict {
$v = preg_replace('/\sNULL/i','',$v);
}
- if (preg_match('/^([^ ]+) .*DEFAULT ([^ ]+)/',$v,$matches)) {
+ if (preg_match('/^([^ ]+) .*DEFAULT (\'[^\']+\'|\"[^\"]+\"|[^ ]+)/',$v,$matches)) {
$existing = $this->MetaColumns($tabname);
list(,$colname,$default) = $matches;
$v = preg_replace('/^' . preg_quote($colname) . '\s/', '', $v);