mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Must double quote the schema name in query
Schema names with reserved words such as "create" will fail this query without double quotes. Attempted prepared statement with ? placeholder. This failed with the following CakePHP error: Error: A Database connection using "Postgres" was missing or unable to connect. The database server returned this error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "$1" LINE 1: SET search_path TO $1 ^
This commit is contained in:
parent
b728bced73
commit
ed749fdc97
1 changed files with 1 additions and 1 deletions
|
@ -127,7 +127,7 @@ class Postgres extends DboSource {
|
|||
$this->setEncoding($config['encoding']);
|
||||
}
|
||||
if (!empty($config['schema'])) {
|
||||
$this->_execute('SET search_path TO ' . $config['schema']);
|
||||
$this->_execute('SET search_path TO "' . $config['schema'] . '"');
|
||||
}
|
||||
if (!empty($config['settings'])) {
|
||||
foreach ($config['settings'] as $key => $value) {
|
||||
|
|
Loading…
Add table
Reference in a new issue