|
@@ -38,11 +38,19 @@ class Core_Pdo extends PDO {
|
|
|
public function identifierQuote($identifier) {
|
|
public function identifierQuote($identifier) {
|
|
|
switch (strtolower($this->_type)) {
|
|
switch (strtolower($this->_type)) {
|
|
|
// case 'pgsql': return $identifier;
|
|
// case 'pgsql': return $identifier;
|
|
|
- case 'pgsql': return "\"{$identifier}\""; // https://www.postgresql.org/docs/9.1/sql-syntax-lexical.html
|
|
|
|
|
|
|
+ case 'pgsql': return $this->pgsqlIdentifierQuote($identifier);
|
|
|
case 'mysql': return "`{$identifier}`";
|
|
case 'mysql': return "`{$identifier}`";
|
|
|
}
|
|
}
|
|
|
return $identifier;
|
|
return $identifier;
|
|
|
}
|
|
}
|
|
|
|
|
+ function pgsqlIdentifierQuote($identifier) {
|
|
|
|
|
+ if (false !== strpos($identifier, '.')) {
|
|
|
|
|
+ return implode('.', array_map(function ($token) {
|
|
|
|
|
+ return "\"{$token}\"";
|
|
|
|
|
+ }, explode('.', $identifier)));
|
|
|
|
|
+ }
|
|
|
|
|
+ return "\"{$identifier}\""; // https://www.postgresql.org/docs/9.1/sql-syntax-lexical.html
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
public function tableNameQuote($tableName) {
|
|
public function tableNameQuote($tableName) {
|
|
|
switch (strtolower($this->_type)) {
|
|
switch (strtolower($this->_type)) {
|